From: Junio C Hamano <gitster@pobox.com>
To: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Cc: Rasmus Villemoes <ravi@prevas.dk>, git@vger.kernel.org
Subject: Re: customizing "cherry picked from commit abcd" comment
Date: Tue, 30 Sep 2025 08:39:29 -0700 [thread overview]
Message-ID: <xmqq5xd054r2.fsf@gitster.g> (raw)
In-Reply-To: <aNus0ulSTb4rAYdF@ugly.lan> (Oswald Buddenhagen's message of "Tue, 30 Sep 2025 12:11:30 +0200")
Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:
> i sometimes customize this pseudo-footer as well, but it's usually
> things like "(partially cherry-picked ...)" or "(... from
> <repo>/<sha1>)", etc.
That does sound a sensible thing to do, assuming that the original
commit is public. See below for a backstory why it is only a commit
object name and nothing else.
> your particular use case would imo be better addressed by implementing
> bi-directional linking between picked commits via a standardized
> git-notes namespace.
A nice property of notes is that they can be added after the fact
and can be mde bidirectional, so in a workflow allows adopting this
great suggestion, it is a very sensible thing to do.
> the pseudo-trailer is really just a hack in the first place, and
> afaict that status quo results from an ideological commitment against
> cherry-picks during the early history of git. but it's really kinda
> silly that subversion and perforce have better tracking of
> cherry-picks to this date, even when it's their only way to do merges.
I do not know what "an ideological commitment" refers to in this
context, but if I recall correctly, the reason why I originally
added the "cherry picked from" message in 48313592 (Redo "revert"
using three-way merge machinery., 2005-08-27) was because of
end-user requests, and given that the linux-kernel was pretty much
the only large customer back then, I suspect it came from there.
The intention was for the original commit to be also be public and
in the same project (e.g., you cherry-pick a commit from the main
branch developing towards the next great version, down to a
maintenance branch for the previous release), which made the commit
object name alone an sufficient identifier (also, this way predated
the invention of "git show -s --format=reference", so it is really
a dry hexadecimal object name and nothing else).
Initially, the feature to add the message was enabled by default.
Without passing an option, you always got the message in the
cherry-picked result.
Later, it was found that people ended up many commits with "cherry
picked from" messages that refer to commit objects that are not
available anywhere, because they cherry-pick across their private
branches while developing their patches, and the practice started
littering the public commits with these "useless" (because they do
not point at any commits that are part of anybody's official
history) references to the original commits they were cherry-picked
from. And this made us turn the feature off by default, adding the
message only when the user explicitly asks to do so.
next prev parent reply other threads:[~2025-09-30 15:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq5xd054r2.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=oswald.buddenhagen@gmx.de \
--cc=ravi@prevas.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).