Subject: Re: [PATCH] pretty: add X-Change-ID to mail formats

From: "Remo Senekowitsch" <[email-masked]>
Date: Thu, 03 Jul 2025 10:41:06 +0200

Hi Drew,

Thank you, this is exciting!

On Thu Jul 3, 2025 at 9:45 AM CEST, Drew DeVault wrote:
> I have refrained from implementing the git-am part of this work for now,
> on the basis that I'm not sure how downstream tools like Jujutsu would
> feel if git wrote the change-id header to new commits. Would that
> conflict with some internal deterministic process for coming up with the
> change-id that could come up with a different answer, leading to
> conflicts?

This would be no problem at all. Jujutsu would very much welcome if Git
preserved the change-id header, including for patches sent by email.
Jujutsu generates the initial change-id randomly and since any part of
the commit can change while the change-id remains stable, there is no
deterministic process that could be interfered with if Git wrote the
change-id header to new commits. So, there are no objections from my
side to implementing the git-am part as well. :-)

This can kind of be tested already. Because Jujutsu already writes the
change-id header and sends it via git push, it must also be able to
import those headers from commits it hasn't seen before. Possible steps
to verify this behavior:

* Create a repo with Jujutsu, make some commits, push them to a remote.
  (can be one on the local file system)

* Clone this repo via Git.

* (optional) Confirm with `git cat-file -p @` that the change-id header
  was preserved.

* Run `jj git init --colocate .` to upgrade the git repo to a jj repo.

* Run `jj log` and observe that Jujutsu correctly imported the change-id
  headers of existing commits it didn't know about previously.

Best regards,
Remo