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

Re: [RFC PATCH 2/4] change submodule push test to use proper repository setup

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 11, 2017, 00:19 UTC
Message-ID
<xmqq376qpmcn.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqq7ew2pokm.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> A few questions that come to mind are:
>
>  - Does "git add sub/" have enough information to populate
>    .gitmodules?  If we have reasonable "default" values for
>    .gitmodules entries (e.g. missing URL means we won't fetch when
>    asked to go recursively fetch), perhaps we can leave everything
>    other than "submodule.$name.path" undefined.
> ...
>  - ...  IOW, if "git add sub/" can
>    add .gitmodules to help people without having to type "git
>    submodule add sub/", then we can give exactly the same degree of
>    help without even modifying .gitmodules when "git add sub/" is
>    run.

Answering my own questions (aka correcting my own stupidity), there is a big leap/gap between the two that came from my forgetting an important point: a local repository has a lot richer information than others that are clones of it.

"git add sub/" could look at sub/.git/config and use that information when considering what values to populate .gitmodules with. It can learn where its origin remote is, for example.

And while this can do that at look-up time locally (i.e. removing the need to do .gitmodules), those who pull from this local repository, of those who pull from a shared central repository this local repository pushes into, will not have the same information available to them, _unless_ this local repository records it in the .gitmodules file for them to use.

So, I think "git add sub/" that adds to .gitmodules would work (unless the sub/ repository originates locally without pushing out--in which case, submodule.$name.url cannot be populated with a value suitable for other people, and we should continue warning), while doing the same at look-up time would not be a good solution.

Previous: Stefan BellerNext: Heiko Voigt
Message 9 of 18 in “implement fetching of moved submodules”
  1. 0/4 implement fetching of moved submodulesHeiko Voigt, Oct 6, 2017
  2. 1/4 fetch: add test to make sure we stay backwards compatibleHeiko Voigt, Oct 6, 2017
  3. 2/4 change submodule push test to use proper repository setupHeiko Voigt, Oct 6, 2017
  4. Stefan BellerOct 9, 2017
  5. Heiko VoigtOct 10, 2017
  6. Stefan BellerOct 10, 2017
  7. Junio C HamanoOct 10, 2017
  8. Stefan BellerOct 10, 2017
  9. Junio C HamanoOct 11, 2017
  10. Heiko VoigtOct 11, 2017
  11. Junio C HamanoOct 12, 2017
  12. Heiko VoigtOct 11, 2017
  13. Josh TriplettOct 11, 2017
  14. Brandon WilliamsOct 12, 2017
  15. 4/4 submodule: simplify decision tree whether to or not to fetchHeiko Voigt, Oct 6, 2017
  16. 3/4 implement fetching of moved submodulesHeiko Voigt, Oct 6, 2017
  17. Stefan BellerOct 6, 2017
  18. Junio C HamanoOct 7, 2017

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.