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

`cherry-pick -x' and git-interpret-trailers

From
NSNicholas Sielicki <vger+git@opensource.nslick.com>
Date
Oct 28, 2024, 18:43 UTC
Message-ID
<ab71a27d-728e-425a-8729-8699c9369bca@app.fastmail.com>

If one uses `git cherry-pick -x' to apply a commit to a stable branch from elsewhere, git appends something like:

> Tested-by: Some Teammate <some.teammate@somedomain.com>
> Signed-off-by: Some User <some.user@somedomain.com>
> (cherry picked from commit 2efe13923d0ff714b1b0f3b7175e714f0e295727) <--- this
IMO this is inconsistent in two ways:
1. it's unclear to me why the cherry-pick metadata isn't emitted in
trailer form, ie: `Cherry-Picked-From-Commit: <...>', making it work
with `git-interpret-trailers'.
2. I'm not sure if any tooling (external or otherwise) breaks because
of this, but the existing trailers now have non-trailer content
following them, so it's ambiguous whether they still qualify as
trailers at first glance. (possibly, this is intentional?)

Realistically, the only thing worse than this^ would be to have a mixture of two formats in the same repository, which is to say, without a surefire way to to share repository config defaults, I can't imagine there's a backwards-compatible solution to changing the `-x' default behavior and git is stuck with it.

It could be possible to extend the existing behavior with git-notes? Added benefit of that would be that you could mark both commits involved with `Cherry-Picked-By' and `Cherry-Picked-From'.

Next: Kristoffer Haugsbakk
Message 1 of 2 in “`cherry-pick -x' and git-interpret-trailers”
  1. Nicholas SielickiOct 28, 2024
  2. Kristoffer HaugsbakkOct 28, 2024

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.