From: Phillip Wood <phillip.wood123@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>,
Elijah Newren <newren@gmail.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH] [RFC] rebase -m: partial support for copying extra commit headers
Date: Wed, 9 Apr 2025 15:11:19 +0100 [thread overview]
Message-ID: <7f744f34-050c-4d8b-b5fc-aae622c3c5b6@gmail.com> (raw)
In-Reply-To: <xmqqr022yaq6.fsf@gitster.g>
Hi Junio
On 08/04/2025 15:44, Junio C Hamano wrote:
> Phillip Wood <phillip.wood123@gmail.com> writes:
>
>> Thanks for sharing that, it is an interesting list. On the subject of
>> encoding I do think our documentation could be clearer that the
>> encoding applies to all the headers as well as the commit message. As
>> far as I can see it only mentions the commit message, not the author
>> or committer identities but repo_logmsg_reencode() re-encodes the
>> whole commit buffer. Out of interest do you think we could be doing a
>> better job with fsck to pick up some of these problems earlier?
>>
>> I think "git rebase" only cares that the author identity can be parsed
>> by split_ident() which is fairly lenient.
>
> "rebase" already knows that it has to be picky which header fields
> need to be propagated and which must not be, doesn't it?
I'd say it's picky because of the way it is implemented - it calls "git
commit" and there is no way to set "extra" header fields when doing that.
> Can the
> same be said for arbitrary "extra" header fields?
>
> Information on some of the header fields are inherently destroyed
> when you refine an existing commit. The value on the 'parent'
> headers may need to be updated (unless "rebase" is fast-forwarding
> an earlier part of the changes on the same base), the 'author'
> information usually wants to be preserved, but when the scale of the
> change since the previous iteration is so large, you may give it a
> new authorship, the 'committer' information should record who
> created the new commit object that records the result of rebasing,
> the 'gpgsig' and 'gigsig-sha256' header fields would lose validity
> if you are creating a new object that is different from the original
> by even a single bit (if we are somehow recording which predecessor
> commit the new one replaces, it certainly is safe to drop these that
> have lost validity, as we can go back to the predecessor to see it
> has a valid signature, and the change in the new commit that lost
> the signature fields is the moral equivalent of the original.
> Otherwise, carrying a stale signature may serve as a reminder that
> the commit was rewritten in the past---I dunno). And so on.
>
> Now, one thing that worries me is this. If "extra" commit headers
> include truly extra fields with unknown semantics, the machinery
> cannot tell which ones are safe and benefitial to propagate.
That's true and we could have a config key to select which "extra"
headers are propagated. We do however unconditionally propagate all
"extra" headers when amending a commit with "git commit --amend" and
when rewriting it with "git replay" which I think GitHub have been using
to rebase branches for over 18 months. If we're worried about rebase
unconditionally copying these headers we do something to stop "git
replay" doing the same. On the other hand if "git replay" is being used
in the wild without problems maybe we don't need to worry.
Best Wishes
Phillip
next prev parent reply other threads:[~2025-04-09 14:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 15:52 [PATCH] [RFC] rebase -m: partial support for copying extra commit headers Phillip Wood via GitGitGadget
2025-04-08 1:22 ` brian m. carlson
2025-04-08 10:15 ` Phillip Wood
2025-04-08 14:44 ` Junio C Hamano
2025-04-09 14:11 ` Phillip Wood [this message]
2025-04-09 15:36 ` Junio C Hamano
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=7f744f34-050c-4d8b-b5fc-aae622c3c5b6@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=newren@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=ps@pks.im \
--cc=sandals@crustytoothpaste.net \
/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).