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
Patrick Steinhardt <ps@pks.im>
Date
Sep 4, 2026, 09:41 UTC
Message-ID
<apqSXT4lT7v0ILjp@pks.im>
In-Reply-To
<20260903214553.53942-1-f@lex.la>
On Fri, Sep 04, 2026 at 12:45:53AM +0300, Aleksei Sviridkin wrote:
Show 17 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> > 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.
> > [...]
> > Can you help me understand the above two paragraphs a bit better?
> 
> The test pins the one combination t3507 did not cover. The file already
> checks CHERRY_PICK_HEAD after a conflicting pick, after a clean pick, and
> after a clean pick under --no-commit, but not after a conflicting pick
> under --no-commit. That is the case a user hits by accident: the pick
> stops on conflicts, they resolve and run "git commit", and the original
> author is not restored. --no-commit never wrote the ref, d7e5c0cbfb skips
> it on purpose. Your reading is right and Gemini's is backwards: under
> --no-commit we do not want CHERRY_PICK_HEAD, and the test asserts it is
> absent. Without it, teaching git to write the ref there would leave the
> whole file green.

The question is whether it really makes sense to have tests for every single edge case. In a perfect world we of course would, but in the real world there are a) gazillions of different combinations and b) every test brings its own overhead as it increases both wall time and maintenance costs.

That doesn't specifically mean that this one test you add here is not useful. But we need to have a better argument than "we didn't have it yet". For example we might've seen regressions, the logic is extremely fragile or we risk bad consequences like data loss or an unrecoverable situation if a property does not hold.

It's a thin line to walk at times, and I usually wouldn't care about this too much. But over the last couple weeks we've seen more patch series that add random tests to our test case without good reasoning just for the sake of adding a test. And that's something that we need to contain a bit.

Thanks!
Patrick
Previous: Aleksei SviridkinNext: Aleksei Sviridkin
Message 5 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.