Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Aleksei Sviridkin <f@lex.la>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit
Date: Thu, 03 Sep 2026 14:32:14 -0700	[thread overview]
Message-ID: <xmqq7bl29g2p.fsf@gitster.g> (raw)
In-Reply-To: <20260903125524.67889-1-f@lex.la> (Aleksei Sviridkin's message of "Thu, 3 Sep 2026 15:55:23 +0300")

Aleksei Sviridkin <f@lex.la> writes:

> The tests here check the ref after a conflicting pick, after a clean
> pick and after a clean pick under --no-commit, but not after a
> conflicting one under --no-commit.  That is the combination a user
> runs into by accident: the pick stops with conflicts, and the ref
> "git commit" would take the authorship from is not there.
>
> Pin it next to its siblings.  Letting the ref be written under
> --no-commit when the pick conflicts leaves the rest of the cherry-pick
> tests green, so nothing else guards that path.

It is not apparent what problem, if any, the description
above claims the commit addresses.  Nor is it clear why
checking these combinations is relevant.

I also fail to parse what the second paragraph intends to say.
What does "it" refer to in "Pin it next to its siblings"?  A new
test?  Any test inserted into a sequence will naturally sit
adjacent to its neighbors, so calling them "its siblings" offers
little clue to help the reader understand the change.

Can you help me understand the above two paragraphs a bit better?

Thanks.

P.S.

I shamelessly asked an AI agent I had nearby to guess what your log
message might have meant and got the following.  I am not sure if
that matches what you wanted to say, or if it is totally off the
mark, but at least I can follow what it is trying to say, even
though I do not think if that matches reality (for example, when
"--no-commit" is in effect, we probably do not want CHERRY_PICK_HEAD,
even though the version of the text given by Gemini below claims it
is needed).

    When a cherry-pick is run with the --no-commit option and halts
    due to conflicts, Git must still write the CHERRY_PICK_HEAD ref.
    This ref is necessary because a subsequent "git commit" relies
    on it to preserve the authorship metadata of the original
    commit.

    Add a new test alongside the existing cherry-pick tests to
    verify this behavior.  The test suite currently checks for
    CHERRY_PICK_HEAD after a conflicting pick, after a clean pick,
    and after a clean pick with --no-commit.  However, it lacks
    coverage for a conflicting pick with --no-commit.  Indeed, if
    Git is modified to stop writing the ref in this specific
    scenario, all existing tests still pass.  This new test closes
    the coverage gap.





>
> Assisted-by: LLM
> Signed-off-by: Aleksei Sviridkin <f@lex.la>
> ---
>  t/t3507-cherry-pick-conflict.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
> index 44596cb1e8..2ce2e88184 100755
> --- a/t/t3507-cherry-pick-conflict.sh
> +++ b/t/t3507-cherry-pick-conflict.sh
> @@ -100,6 +100,12 @@ test_expect_success 'cherry-pick --no-commit does not set CHERRY_PICK_HEAD' '
>  	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD
>  '
>  
> +test_expect_success 'failed cherry-pick --no-commit does not set CHERRY_PICK_HEAD' '
> +	pristine_detach initial &&
> +	test_must_fail git cherry-pick --no-commit picked &&
> +	test_must_fail git rev-parse --verify CHERRY_PICK_HEAD
> +'
> +
>  test_expect_success 'cherry-pick w/dirty tree does not set CHERRY_PICK_HEAD' '
>  	pristine_detach initial &&
>  	echo foo >foo &&
>
> base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc

  parent reply	other threads:[~2026-09-03 21:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 12:55 [PATCH 1/2] t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit Aleksei Sviridkin
2026-09-03 12:55 ` [PATCH 2/2] doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD Aleksei Sviridkin
2026-09-03 21:32 ` Junio C Hamano [this message]
2026-09-03 21:45   ` [PATCH 1/2] t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit Aleksei Sviridkin
2026-09-04  9:41     ` Patrick Steinhardt
2026-09-04 12:45       ` Aleksei Sviridkin
2026-09-04 13:53       ` Phillip Wood
2026-09-05 17:13         ` Aleksei Sviridkin
2026-09-04 16:17       ` Junio C Hamano
2026-09-05 17:13       ` Aleksei Sviridkin
2026-09-04  9:53   ` Phillip Wood
2026-09-04 16:20     ` Junio C Hamano
2026-09-04  9:57 ` Phillip Wood
2026-09-04 12:45   ` Aleksei Sviridkin
2026-09-04 13:57     ` Phillip Wood
2026-09-05 17:13       ` Aleksei Sviridkin
2026-09-04 12:44 ` [PATCH v2] doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD Aleksei Sviridkin
2026-09-05 16:29   ` Junio C Hamano
2026-09-05 17:13 ` [PATCH v3 0/2] cherry-pick: document that " Aleksei Sviridkin
2026-09-05 17:13   ` [PATCH v3 1/2] t3507: check no CHERRY_PICK_HEAD after conflicting --no-commit Aleksei Sviridkin
2026-09-05 17:13   ` [PATCH v3 2/2] doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD Aleksei Sviridkin

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=xmqq7bl29g2p.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=f@lex.la \
    --cc=git@vger.kernel.org \
    /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