`cherry-pick -x' and git-interpret-trailers
- From
- Nicholas 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'.