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

Re: [PATCH] submodule: show inconsistent .gitmodules precedence

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 28, 2023, 01:23 UTC
Message-ID
<xmqqo7l0e5x3.fsf@gitster.g>
In-Reply-To
<pull.1538.git.git.1687910254473.gitgitgadget@gmail.com>
"Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 10 quoted lines
>   [submodule "sub"]
>     path = path1
>     path = path2
>
> It's clearly misconfigured, but our docs don't state what we do in this
> situation. If one checks this with "test-tool submodule-config", you'd
> see that we ignore every value after the first (aka first-one-wins) and
> issue a warning. *But* if you actually tried this with "git submodule",
> you'd find it practically impossible to trigger this behavior - what you
> actually see is last-one-wins!

The last-one-wins sounds like a natural outcome for reusing the config reading machinery, and the first-one-wins sounds like a total confusion, but we probably should fail any operation before the user fixes the .gitmodules by removing all but one path for each submodule. Otherwise we risk operating on wrong submodules (e.g. we may think we are running deinit on "sub" at path #1, but the code may deinit something different).

Thanks.
Previous: Glen Choo via GitGitGadgetNext: Glen Choo
Message 2 of 3 in “submodule: show inconsistent .gitmodules precedence”
  1. submodule: show inconsistent .gitmodules precedenceGlen Choo via GitGitGadget, Jun 27, 2023
  2. Junio C HamanoJun 28, 2023
  3. Glen ChooJun 28, 2023

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.