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

customizing "cherry picked from commit abcd" comment

From
RVRasmus Villemoes <ravi@prevas.dk>
Date
Sep 29, 2025, 12:10 UTC
Message-ID
<87v7l18nnt.fsf@prevas.dk>
Hi,

When working on a custom U-Boot or linux kernel based of some vX.Y, I often end up cherry-picking fixes from upstream. Using "cherry-pick -x" is nice, but I usually amend the commit so that it doesn't just say

    (cherry picked from commit bfbbd8472edbcff1f530ef8e1d74c56af74ecf13)
but instead
    (cherry picked from commit bfbbd8472edbcff1f530ef8e1d74c56af74ecf13 aka v2025.01-rc2~35^2~5)

This makes it easier, when porting to v+1, to know if that commit still needs to be cherry-picked or is already included, and also makes it obvious to anyone reading the current history to know the "upstream status" of that commit.

Now editing in that, which I get from "git describe --contains --match=v*", is not too onerous, but I'd still like a way to automate it. What I imagine is some config knob indicating an executable to call with a single argument, the full sha1 of the cherry-picked commit, and using that executable's stdout in lieu of the default -x message.

Of course, it's quite possible that the script cannot find anything meaningful to say. So one would have to define what it means if it prints nothing on stdout, and/or what it means if it exits unsuccessfully. I'm leaning on saying "exit 0 => use stdout as-is, even if empty; exit != 0 => fail the cherry pick operation", but I can certainly be convinced that some other behaviour is more sensible, e.g. having some combination indicate "fall back to the default message".

Is this something that others could find useful, or is it too niche? If the former, I'll try to cook up a patch, but I'd also like some input on what the semantics should be, or if there's some other idea for achieving the same thing without a custom callback.

Rasmus
Next: Oswald Buddenhagen
Message 1 of 7 in “customizing "cherry picked from commit abcd" comment”
  1. Rasmus VillemoesSep 29, 2025
  2. Oswald BuddenhagenSep 30, 2025
  3. Junio C HamanoSep 30, 2025
  4. Oswald BuddenhagenOct 1, 2025
  5. Junio C HamanoOct 2, 2025
  6. Oswald BuddenhagenOct 3, 2025
  7. brian m. carlsonSep 30, 2025

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.