git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/2] pretty: add X-Change-ID to mail formats

From
DDDrew DeVault <drew@ddevault.org>
Date
Jul 7, 2025, 07:09 UTC
Message-ID
<DB5MUUDPF6C0.3OR02N6JQB8H8@ddevault.org>
In-Reply-To
<xmqqfrf8ait6.fsf@gitster.g>
On Mon Jul 7, 2025 at 3:30 AM CEST, Junio C Hamano wrote:
Show 11 quoted lines
> 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.

+1. I particularly like how this approach throws out a bunch of arguing over the utility of the specific use-case -- clever :)

Do you think there's any reason not to throw all extra headers into X-git-extra-commit-header (or whatever) unconditionally? Does it need to be behind a flag or config option? If some tool added the extra commit headers, they presumably have a good reason for doing so and we ought to encode that information so we can reproduce the commit properly, same as we would with the rest of the commit headers.

I suppose there is a scenario where this breaks something because someone has a poorly thought-out string munging parser for git format-patch output that will barf upon encountering the unexpected, or some mail provider rejects emails rather than silently dropping headers it doesn't like, but both possibilities seem remote -- especially when considering that these hypothetical edge cases have to be combined with a use-case which deploys extra commit headers in the first place.

Previous: Drew DeVaultNext: Remo Senekowitsch
Message 13 of 17 in “pretty: add X-Change-ID to mail formats”
  1. 1/2 pretty: add X-Change-ID to mail formatsDrew DeVault, Jul 3, 2025
  2. 2/2 am: import X-Change-ID from email headersDrew DeVault, Jul 3, 2025
  3. Jeff KingJul 6, 2025
  4. Drew DeVaultJul 6, 2025
  5. Aditya GargJul 6, 2025
  6. Drew DeVaultJul 6, 2025
  7. Junio C HamanoJul 7, 2025
  8. Junio C HamanoJul 7, 2025
  9. Martin von ZweigbergkJul 7, 2025
  10. Martin von ZweigbergkJul 7, 2025
  11. Junio C HamanoJul 7, 2025
  12. Drew DeVaultJul 7, 2025
  13. Drew DeVaultJul 7, 2025
  14. Remo SenekowitschAug 19, 2025
  15. Drew DeVaultAug 20, 2025
  16. Junio C HamanoAug 21, 2025
  17. Drew DeVaultAug 21, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.