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
Jeff King <peff@peff.net>
Date
Jul 6, 2025, 03:37 UTC
Message-ID
<20250706033710.GD3041790@coredump.intra.peff.net>
In-Reply-To
<20250703113505.11889-1-drew@ddevault.org>
On Thu, Jul 03, 2025 at 01:29:51PM +0200, Drew DeVault wrote:
> One remark that occurs to me upon spinning v2 is that I'm not sure how
> to test this behavior. There is no obvious way to cause git upstream to
> produce a commit with a change-id -- presently these are only ever added
> by third-party tools.

I don't have any opinion on the feature itself, but the plumbing way to do it would perhaps be:

  # make some vanilla commit...
  git commit -m foo &&
  # make a new variant with the change id
  commit=$(
    git cat-file commit HEAD |
    perl -lpe 'print "change-id foo" unless length' |
    git hash-object -w --stdin -t commit
  ) &&
  # replace the old one
  git update-ref HEAD $commit

which would be enough for Git's test suite. If this is something that other third-party tools are going to start adding, it might be worth adding some tests to Git's suite anyway to make sure it is handled correctly. (I didn't follow the discussion on whether a new commit header was something the Git project wanted to endorse, versus sticking it in a trailer line, so don't take this as either a positive or negative on the approach).

-Peff
Previous: Drew DeVaultNext: Drew DeVault
Message 3 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.