From: Junio C Hamano <gitster@pobox.com>
To: "Glen Choo via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Jesse Kasky <jkasky@slack-corp.com>,
Derrick Stolee <derrickstolee@github.com>,
Jonathan Tan <jonathantanmy@google.com>,
Glen Choo <chooglen@google.com>
Subject: Re: [PATCH] config: don't BUG when both kvi and source are set
Date: Mon, 26 Jun 2023 12:06:42 -0700 [thread overview]
Message-ID: <xmqq352e59h9.fsf@gitster.g> (raw)
In-Reply-To: <pull.1535.git.git.1687801297404.gitgitgadget@gmail.com> (Glen Choo via GitGitGadget's message of "Mon, 26 Jun 2023 17:41:37 +0000")
"Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Therefore, fix the bug by removing the BUG() check. We're reverting to
> an older, less safe state, but that's generally okay since
> key_value_info is always preferentially read, so we'd always read the
> correct values when we iterate a config set in the middle of a config
> parse (like we are here).
I wonder if the source being pushed and config_kvi value at this
point have some particular relationship (like "if kvi exists, the
source must match kvi's source" or something) that we can cheaply
use to avoid "reverting to an older less safe state"?
I would agree that, as long as we know by the end of this summer a
real fix would come to rescue us ;-), it is sensible not to add too
much code to work it around for the short-term.
> The reverse would be wrong, but extremely
> unlikely to happen since very few callers parse config without going
> through a config set.
Sorry, but I do not quite get this comment.
> Here's a quick fix for the bug reported at [1]. As noted in the commit
> message and that thread, I think the real fix to take [2], which
> simplifies the config.c state and makes this a non-issue, so this is
> just a band-aid while we wait for that.
Thanks for a quick fix. Will queue.
> diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
> index f519d2a87a7..8759fc28533 100755
> --- a/t/t5616-partial-clone.sh
> +++ b/t/t5616-partial-clone.sh
> @@ -257,8 +257,8 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
> test_commit -C submodule mycommit &&
>
> test_create_repo src_with_sub &&
> - test_config -C src_with_sub uploadpack.allowfilter 1 &&
> - test_config -C src_with_sub uploadpack.allowanysha1inwant 1 &&
> + git -C src_with_sub config uploadpack.allowfilter 1 &&
> + git -C src_with_sub config uploadpack.allowanysha1inwant 1 &&
We only tentatively configured uploadpack in src_with_sub in the
original because this single test piece was the only place where
src_with_sub repository was used, but now we use a more permanent
configuration because ...
> @@ -270,6 +270,12 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
> test_when_finished rm -rf dst
> '
>
> +test_expect_success 'lazily fetched .gitmodules works' '
> + git clone --filter="blob:none" --no-checkout "file://$(pwd)/src_with_sub" dst &&
> + git -C dst fetch &&
> + test_when_finished rm -rf dst
> +'
... we run another "git clone" from the repository now.
OK.
Thanks.
next prev parent reply other threads:[~2023-06-26 19:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 17:41 [PATCH] config: don't BUG when both kvi and source are set Glen Choo via GitGitGadget
2023-06-26 19:06 ` Junio C Hamano [this message]
2023-06-26 22:56 ` Glen Choo
2023-06-26 23:05 ` Junio C Hamano
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=xmqq352e59h9.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=chooglen@google.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=jkasky@slack-corp.com \
--cc=jonathantanmy@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).