git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Phil Hord <hordp@cisco.com>
Date
Jun 23, 2011, 20:01 UTC
Message-ID
<4E039BA7.8060302@cisco.com>
In-Reply-To
<7v7h8c4nv3.fsf@alter.siamese.dyndns.org>
On 06/23/2011 10:35 AM, Junio C Hamano wrote:
Show 17 quoted lines
> Maarten Billemont <lhunath@gmail.com> 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
Previous: Jens LehmannNext: Junio C Hamano
Message 13 of 15 in “''git submodule sync'' should not add uninitialized submodules to .git/config”
  1. Maarten BillemontJun 23, 2011
  2. Phil HordJun 23, 2011
  3. Junio C HamanoJun 23, 2011
  4. Jens LehmannJun 23, 2011
  5. Junio C HamanoJun 23, 2011
  6. Andreas KöhlerJun 23, 2011
  7. Jens LehmannJun 24, 2011
  8. Re* ''git submodule sync'' should not add uninitialized submodules to .git/configJunio C Hamano, Jun 24, 2011
  9. Jens LehmannJun 24, 2011
  10. submodule add: always initialize .git/config entryJens Lehmann, Jun 25, 2011
  11. Junio C HamanoJun 30, 2011
  12. submodule sync: do not auto-vivify uninteresting submoduleJens Lehmann, Jun 25, 2011
  13. Phil HordJun 23, 2011
  14. Junio C HamanoJun 23, 2011
  15. Phil HordJun 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.