git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Drew DeVault" <drew@ddevault.org>
Cc: "Aditya Garg" <gargaditya08@live.com>,  <git@vger.kernel.org>,
	 "Martin von Zweigbergk" <martinvonz@google.com>,
	 "Patrick Steinhardt" <ps@pks.im>,
	 "Andy Koppe" <andy.koppe@gmail.com>,
	 "Remo Senekowitsch" <remo@buenzli.dev>,
	 "Jeff King" <peff@peff.net>
Subject: Re: [PATCH v2 1/2] pretty: add X-Change-ID to mail formats
Date: Sun, 06 Jul 2025 18:30:45 -0700	[thread overview]
Message-ID: <xmqqfrf8ait6.fsf@gitster.g> (raw)
In-Reply-To: <DB4WQTRHWZN3.3VG20AZDK8VN@ddevault.org> (Drew DeVault's message of "Sun, 06 Jul 2025 12:41:50 +0200")

"Drew DeVault" <drew@ddevault.org> writes:

> Trailers and headers are different. The main point of the change-id
> discussion earlier on this list was to avoid adding trailers.

It sounds like this "avoiding trailers" is the root cause of the
problem.  If change-id is something not precious as you earlier
said, having various operations lose it by design or by accident
may not hurt a lot, but then doesn't it make it harder to notice
by hiding it in a non-standard commit header field?  There is no
easy way to tell "git log --format" to show such a custom header,
you'd need to tell amend, rebase, cherry-pick, etc. to carry the
custom header forward (or not---have all the change-id loving
communities agreed on when to propagate and when not to?).

Keeping it as one of the trailer fields will always make it
available [*], propagate existing one by default with any existing
tool, and because it is in the same place as log message, the user
can easily remove it if it is not appropriate to keep it.

    Side note: [*] Unless you are doing "log --oneline", that is,
    but I'd say at that point you are hiding it deliberately.

> I also suspect that if we added this as an "inbody header" that older
> git implementations would ingest the X-Change-ID header into the commit
> message, which is not a desirable behavior.

Of course not.  If the thing is a trailer, you do not even have to
worry about such sillyness caused by adding it as a new in-body
header.

> IMO the right way forward is to use a mail header.

No.  In the change-id case, trailer is the right way to go.

Having said all that, you may sense that I am not all that impressed
by the previous rounds of dicsussions arguing for recording
change-id as an extra non-standard commit header.  We should think
twice or more before making anything that structurally does not
cause Git to behave differently taking advantage of the information
recorded there an extra commit header field.

But after thinking thrice, we may find a set of good pieces of
information that should be added as new commit header that are
structurally more meaningful, and there will be times when we need
to convey them over e-mailed workflow to allow patch recipient not
to lose such information.

In such a case, I fully agree that embedding in an e-mail header
would be the way to go.

I would suggest a lot more generic implementation to solve it once
and for all.  How about doing it more like this:

   "git format-patch --extra-headers" grabs all extra headers
   (i.e. those that are not the bog-standard "tree", "parent",
   "author", "committer") and emit these

    X-git-extra-commit-header: encoding=iso8859-1
    X-git-extra-commit-header: frotz=nitfol

   next to "Subject:", etc.


  reply	other threads:[~2025-07-07  1:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 11:29 [PATCH v2 1/2] pretty: add X-Change-ID to mail formats Drew DeVault
2025-07-03 11:29 ` [PATCH v2 2/2] am: import X-Change-ID from email headers Drew DeVault
2025-07-06  3:37 ` [PATCH v2 1/2] pretty: add X-Change-ID to mail formats Jeff King
2025-07-06 10:46   ` Drew DeVault
2025-07-06  6:20 ` Aditya Garg
2025-07-06 10:41   ` Drew DeVault
2025-07-07  1:30     ` Junio C Hamano [this message]
2025-07-07  5:53       ` Junio C Hamano
2025-07-07  6:57         ` Martin von Zweigbergk
2025-07-07  6:59           ` Martin von Zweigbergk
2025-07-07 12:40             ` Junio C Hamano
2025-07-07  7:12           ` Drew DeVault
2025-07-07  7:09       ` Drew DeVault
2025-08-19 17:45 ` Remo Senekowitsch
2025-08-20  7:29   ` Drew DeVault
2025-08-21  0:50     ` Junio C Hamano
2025-08-21  8:52       ` Drew DeVault

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=xmqqfrf8ait6.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=andy.koppe@gmail.com \
    --cc=drew@ddevault.org \
    --cc=gargaditya08@live.com \
    --cc=git@vger.kernel.org \
    --cc=martinvonz@google.com \
    --cc=peff@peff.net \
    --cc=ps@pks.im \
    --cc=remo@buenzli.dev \
    /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).