git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* customizing "cherry picked from commit abcd" comment
@ 2025-09-29 12:10 Rasmus Villemoes
  2025-09-30 10:11 ` Oswald Buddenhagen
  2025-09-30 15:17 ` brian m. carlson
  0 siblings, 2 replies; 7+ messages in thread
From: Rasmus Villemoes @ 2025-09-29 12:10 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-10-03 11:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-29 12:10 customizing "cherry picked from commit abcd" comment Rasmus Villemoes
2025-09-30 10:11 ` Oswald Buddenhagen
2025-09-30 15:39   ` Junio C Hamano
2025-10-01 11:41     ` Oswald Buddenhagen
2025-10-02  2:49       ` Junio C Hamano
2025-10-03 11:41         ` Oswald Buddenhagen
2025-09-30 15:17 ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).