From: Junio C Hamano <gitster@pobox.com>
To: "Glen Choo via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Glen Choo <chooglen@google.com>
Subject: Re: [PATCH] submodule: show inconsistent .gitmodules precedence
Date: Tue, 27 Jun 2023 18:23:20 -0700 [thread overview]
Message-ID: <xmqqo7l0e5x3.fsf@gitster.g> (raw)
In-Reply-To: <pull.1538.git.git.1687910254473.gitgitgadget@gmail.com> (Glen Choo via GitGitGadget's message of "Tue, 27 Jun 2023 23:57:34 +0000")
"Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes:
> [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.
next prev parent reply other threads:[~2023-06-28 1:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 23:57 [PATCH] submodule: show inconsistent .gitmodules precedence Glen Choo via GitGitGadget
2023-06-28 1:23 ` Junio C Hamano [this message]
2023-06-28 1:36 ` Glen Choo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqo7l0e5x3.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=chooglen@google.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.