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

Re: [PATCH 1/2] t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 4, 2026, 09:57 UTC
Message-ID
<5e77651d-38a1-451e-b96b-33c91c414eb5@gmail.com>
In-Reply-To
<20260903125524.67889-1-f@lex.la>
Hi Alexsei
On 03/09/2026 13:55, Aleksei Sviridkin wrote:
Show 7 quoted lines
> 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.
What does pinning a test mean?
Show 21 quoted lines
> 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.
> 
> 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 &&

We already have a test that checks the advice that's printed when there are conflicts, so could just add

	test_must_fail git show-ref --verify CHERRY_PICK_HEAD

there. Because that test checks the command's output, we know that the cherry-pick has failed due to conflicts, and not some other reason. Using test_must_fail() here without checking the error message means we don't verify the reason that the cherry-pick failed.

Thanks
Phillip
Show 8 quoted lines
> +	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
Previous: Junio C HamanoNext: Aleksei Sviridkin
Message 13 of 21 in “t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit”
  1. 1/2 t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commitAleksei Sviridkin, Sep 3, 2026
  2. 2/2 doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEADAleksei Sviridkin, Sep 3, 2026
  3. Junio C HamanoSep 3, 2026
  4. Aleksei SviridkinSep 3, 2026
  5. Patrick SteinhardtSep 4, 2026
  6. Aleksei SviridkinSep 4, 2026
  7. Phillip WoodSep 4, 2026
  8. Aleksei SviridkinSep 5, 2026
  9. Junio C HamanoSep 4, 2026
  10. Aleksei SviridkinSep 5, 2026
  11. Phillip WoodSep 4, 2026
  12. Junio C HamanoSep 4, 2026
  13. Phillip WoodSep 4, 2026
  14. Aleksei SviridkinSep 4, 2026
  15. Phillip WoodSep 4, 2026
  16. Aleksei SviridkinSep 5, 2026
  17. doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEADAleksei Sviridkin, Sep 4, 2026
  18. Junio C HamanoSep 5, 2026
  19. 0/2 cherry-pick: document that --no-commit skips CHERRY_PICK_HEADAleksei Sviridkin, Sep 5, 2026
  20. 1/2 t3507: check no CHERRY_PICK_HEAD after conflicting --no-commitAleksei Sviridkin, Sep 5, 2026
  21. 2/2 doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEADAleksei Sviridkin, Sep 5, 2026

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.