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
AKAndreas Köhler <andi5.py@gmx.net>
Date
Jun 23, 2011, 23:10 UTC
Message-ID
<4E03C7E5.4050008@gmx.net>
In-Reply-To
<7vboxo2ne9.fsf@alter.siamese.dyndns.org>

Am 24.06.2011 00:28, schrieb Junio C Hamano: ---8<---

Show 16 quoted lines
> Subject: submodule sync: do not auto-vivify uninteresting submodule
> 
> Earlier 33f072f (submodule sync: Update "submodule.<name>.url" for empty
> directories, 2010-10-08) attempted to fix a bug where "git submodule sync"
> command does not update the URL if the current superproject does not have
> a checkout of the submodule.
> 
> However, it did so by unconditionally registering submodule.$name.url to
> every submodule in the project, even the ones that the user has never
> showed interest in at all by running 'git submodule init' command. This
> caused subsequent 'git submodule update' to start cloning/updating submodules
> that are not interesting to the user at all.
> 
> Update the code so that the URL is updated from the .gitmodules file only
> for submodules that already have submodule.$name.url entries, i.e. the
> ones the user has showed interested in having a checkout.
---8<---

I think that describes the situation pretty well and the patch looks good. I will not be able to test it before next week though, do not wait for me.

There are two minor issues for me left. (1) The man page of submodule sync talks about "all submodules" and not "registered submodules". I treated it as "subsequent init" and personally do not restrict the list of submodules, simply because my build would not work without them.

(2) It is confusing to have registered submodules in .git/config without a matching gitlink. Say, you switch between branch a1 with a submodule s with url u1, to a branch without s, you git clean -xdff (url u1 is still in .git/config, right?), and then to a branch a2 with s pointing to url u2. This bugged me.

Ciao, -- andi5

Previous: Junio C HamanoNext: Jens Lehmann
Message 6 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.