Re: [PATCH/RFC 3/7] git-submodule: Fall back on .gitmodules if info not found in $GIT_DIR/config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 12, 2008 at 7:24 AM, Junio C Hamano <junio@xxxxxxxxx> wrote:
> Ping Yin <pkufranky@xxxxxxxxx> writes:
>
>  > Originally, the submodule workflow enforces 'git init' in the beginning
>  > which copies submodule config info from .gitmodules to $GIT_DIR/config.
>  > Then all subcommands except 'init' and 'add' fetch submodule info from
>  > $GIT_DIR/config and .gitmodules can be discarded.
>  >
>  > However, there may be inconsistence between .git/config and .gitmodules
>  > when always using 'git init' at first. If upstream .gitmodules changes,
>  > it is not easy to sync the changes to $GIT_DIR/config.
>
>
> Maybe you missed an earlier thread with Roman Shaposhnik where this issue
>  was discussed and a solution more in line with the original intent of the
>  design of the submodule system was mentioned (actually I should not take
>  credit for that suggestion as it was not mine but somebody else mentioned
>  it back when git-submodule command was initially being designed.  I only
>  recalled there was that one issue in the old discussion but there might
>  have been others)?

You mean use "hooks" to update $GIT_DIR/config with user interaction
when .gitmodules changes? Or give user hints when "git submodule
update" fails?

What you said in that thread is that the url in $GIT_DIR/config is
different from the one in .gitmodules (with protocol change perhaps)
originally, and then the url in .gitmodules changes. So when "git
submodule update" fails, it notices this change and tell the user.

What i mean here is another case. The url in $GIT_DIR/config is the
same as the one in .gitmodules, and then the url in .gitmodules
change. So this change can be synced automatically to $GIT_DIR/config.

However, when both cases happen in the same time, there is no way to
differentiate these two cases. So the command  can't do something
automatically and has to leave all choice to the user.

In an environment with central repositories, all submodule urls will
be the same between $GIT_DIR/config and .gitmodules. It is a little
annoying to give so many users this kind of uneccessary choice if the
submodule url changes in .gitmodules.



-- 
Ping Yin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux