Subject: Re: ''git submodule sync'' should not add uninitialized submodules to .git/config

From: Phil Hord <[email-masked]>
Date: Thu, 23 Jun 2011 16:01:43 -0400

On 06/23/2011 10:35 AM, Junio C Hamano wrote:
> Maarten Billemont <[email-masked]> writes:
>> When I initialize 2/3 submodules of my git repository and do git
>> submodule update, all is fine: Only the 2 submodules that I need are
>> updated.
>>
>> When I run a git submodule sync to update the URLs that may have been
>> changed in .gitmodules, it ADDS the URL of the submodule that was NOT
>> initialized, thus "initializing" it.
>>
>> Now, when I run git submodule update, it starts checking out the third
>> module and my workflow is broken.
> See 33f072f (submodule sync: Update "submodule.<name>.url" for empty
> directories, 2010-10-08), which introduced this behaviour.
>
> cmd_update considers anything that has submodule.<name>.url defined as
> "the user is interested", so I suspect "git submodule sync" should not do
> this.

What about a compromise?  Change git-submodule-sync to skip submodules
which are not already initialized.

I have a patch to do this, but I need to test it still.  If it sounds
right, I'll try to submit it later today.

Phil