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

Re: Semantics of change IDs (Re: Gerrit, GitButler, and Jujutsu projects collaborating on change-id commit footer)

From
Remo Senekowitsch <remo@buenzli.dev>
Date
Apr 22, 2025, 22:24 UTC
Message-ID
<D9DIPNY431IJ.23DG6UL5CIQJ@buenzli.dev>
In-Reply-To
<CALnO6CCjkxv40+5wZ_vwZTKv7Te8Xh--M1fY2wbuOfgJm5LZxw@mail.gmail.com>
On Tue Apr 22, 2025 at 10:17 PM CEST, D. Ben Knoble wrote:
Show 35 quoted lines
> On Wed, Apr 16, 2025 at 7:36 AM Remo Senekowitsch <remo@buenzli.dev> wrote:
>>
>> On Mon Apr 14, 2025 at 9:54 PM CEST, D. Ben Knoble wrote:
>> > On Wed, Apr 9, 2025 at 12:56 PM Nico Williams <nico@cryptonector.com> wrote:
>> >> Let's nail down the semantics of these change ID headers.  Here is a
>> >> proposal to bang on:
>> >>
>> >>  - change IDs get preserved on cherry-pick and on `pick`s in rebases
>> >>
>> >>  - users can manually remove or change these change IDs, naturally,
>> >>    though generall they would not
>> >>
>> >>  - the actual change IDs are either free-form or they are URIs -- pick
>> >>    one, but if they are URIs they should be URIs to CRs, and approved
>> >>    CRs should perhaps have links to integration reports etc.
>> >
>> > Using URIs [to code reviews] looks to me like it makes some
>> > assumptions about what creates or consumes these headers, right?
>> > Especially since the URI should point to a code review… Is there a way
>> > to do that which is downstream-agnostic?
>> >
>> > Further, and maybe this is my ignorance of Gerrit showing: how would
>> > you attach a URI to a local commit when authoring it? You don't have
>> > the review URI when running `git commit`, do you? (Maybe I
>> > misunderstood; I'm seeing an odd chicken-egg problem here.)
>> >
>> > Which begs another question: what/who applies the initial change ID to
>> > a commit and when?
>>
>> These are all great questions, which the originally proposed format
>> (fixed-width reverse-hex) has answers to. I think a URI would be
>> strictly worse.
>
> Well, I think we still missed "what/who applies the initial change ID
> to a commit and when."

The tool that creates the commit, when it creates the commit. In the context of this discussion, that's Git or Jujutsu. If the commit is brand new, generate the change-id randomly. If it's the "spiritual successor" of another commit, use that commit's change-id.

Btw. since the thread was started, the implementation in Jujutsu has been completed and I've been pushing commits with the change-id header to various remotes for a while now. It works well. Forges can start taking advantage of it. (I hope I find time to help work on that.)

Show 59 quoted lines
> But the treatment below is something I agree with and failed to
> convey, I think: namely, URIs seem to encode too much
> "unportable"/"specific" information in Git. I feel like the current
> design is not really "tool-agnostic" as much as "built on a universal
> core." That seems valuable and prone to more longevity.
>
>>
>> * Using a reverse-hex ID makes no assumptions about what consumes these
>>   headers. There can be multiple different consumers which treat the ID
>>   differently with different URI schemes.
>>
>> * Attaching a reverse-hex ID to a local commit when authoring it is
>>   trivial: you generate it randomly.
>>
>> This is one of those cases where being maximally restrictive about the
>> format will enable maximal flexibility downstream.
>>
>> One example: GitHub has a URL scheme that looks like this:
>> github.com/org/repo/compare/<ref1>..<ref2>
>>
>> This doesn't work if the refs contain slashes, as branches sometimes do
>> (e.g. feat/foo, username/bar). If the change-id is a URI, this type of
>> URL scheme doesn't work reliably.
>>
>> That is not to say we should design the change-id around GitHub, it's
>> just an example how making the format more free-form (URI is more
>> free-form than fixed-width reverse-hex) makes it more difficult to get
>> stuff working downstream.
>>
>> And lastly, laser-etching the URI scheme of one particular tool into
>> your commit history means the history is at great risk of degrading
>> over time. URI schemes change, domains change, tools become outdated
>> and are replaced.
>>
>> Adding some ephemeral configuration to a tool that constructs a URI out
>> of a reverse-hex ID on the other hand is trivial.
>
> Yep.
>
>> > PS This discussion feels somewhat related to the classic GitHub
>> > problem of not presenting interdiffs/range-diffs: GitHub shows a
>> > too-flat source diff on force-pushes. Perhaps better web UI tooling
>> > about interdiff review (which I think is one of the things Gerrit
>> > does/wants to do?) makes change IDs less necessary, since interdiffs
>> > help connect evolutions of commits?
>>
>> I think it's the other way around: Building a code review UI built on
>> git and centered around interdiffs today is _hard_, that's why we don't
>> have it yet. Adding change-ids to commits will make it much easier,
>> paving the way for these tools to be implemented.
>
> Fair point, although GitHub's detection of force-pushes makes me think
> it could split a PR into versions at that point, cross-link backwards
> and forwards by one version (from the force-push detection), show
> range-diffs between versions based on the target branch of the merge,
> and even follow the cross-links to show an overall sequence of
> versions.
>
> But I don't work there, so presumably it's harder than that :)

I agree that forges still have a lot of potential to improve their code review UIs even without change-ids. But tracking individual patches across force-pushes is not as easy as calling git range-diff. Its manpage says the output is not stable for machines to read and the algorithm it uses has cubic runtime complexity. Not something I'd want to use on my backend if the user controls the input. So the next best thing is to reimplement it using cheaper (but worse) heuristics. The author timestamp would probably be a good start. But at that point, you're looking at a lot of work for what users will perceive as an unreliable and inconsistent experience.

Show 6 quoted lines
> I sincerely hope to make it easier if it's really that hard! And,
> though my opinion matters little, I'm having a hard time piercing the
> conversation to see a "universal core" that solves the desired
> problem. Maybe I'm not reading carefully enough, and maybe a summary
> would help. I greatly appreciated the work of previous folks to
> summarize the current thread status.

-- Best regards, Remo

Previous: D. Ben KnobleNext: Junio C Hamano
Message 69 of 118 in “Gerrit, GitButler, and Jujutsu projects collaborating on change-id commit footer”
  1. Martin von ZweigbergkApr 2, 2025
  2. Remo SenekowitschApr 2, 2025
  3. Konstantin RyabitsevApr 2, 2025
  4. Konstantin RyabitsevApr 2, 2025
  5. Martin von ZweigbergkApr 2, 2025
  6. Patrick SteinhardtApr 3, 2025
  7. Remo SenekowitschApr 3, 2025
  8. Patrick SteinhardtApr 3, 2025
  9. Elijah NewrenApr 3, 2025
  10. Remo SenekowitschApr 3, 2025
  11. Elijah NewrenApr 3, 2025
  12. Martin von ZweigbergkApr 3, 2025
  13. Patrick SteinhardtApr 4, 2025
  14. Elijah NewrenApr 3, 2025
  15. Remo SenekowitschApr 3, 2025
  16. Kane YorkApr 3, 2025
  17. Elijah NewrenApr 4, 2025
  18. Elijah NewrenApr 4, 2025
  19. Martin von ZweigbergkApr 4, 2025
  20. Nico WilliamsApr 4, 2025
  21. Elijah NewrenApr 4, 2025
  22. Martin von ZweigbergkApr 4, 2025
  23. Patrick SteinhardtApr 4, 2025
  24. Theodore Ts'oApr 3, 2025
  25. Remo SenekowitschApr 3, 2025
  26. Theodore Ts'oApr 5, 2025
  27. Nico WilliamsApr 3, 2025
  28. Remo SenekowitschApr 3, 2025
  29. Martin von ZweigbergkApr 3, 2025
  30. Nico WilliamsApr 3, 2025
  31. Martin von ZweigbergkApr 3, 2025
  32. Elijah NewrenApr 4, 2025
  33. Nico WilliamsApr 4, 2025
  34. Martin von ZweigbergkApr 4, 2025
  35. Nico WilliamsApr 4, 2025
  36. Patrick SteinhardtApr 4, 2025
  37. Nico WilliamsApr 4, 2025
  38. Patrick SteinhardtApr 7, 2025
  39. Junio C HamanoApr 7, 2025
  40. Nico WilliamsApr 7, 2025
  41. Theodore Ts'oApr 8, 2025
  42. Nico WilliamsApr 8, 2025
  43. Theodore Ts'oApr 9, 2025
  44. Junio C HamanoApr 9, 2025
  45. Nico WilliamsApr 9, 2025
  46. Junio C HamanoApr 10, 2025
  47. Martin von ZweigbergkApr 10, 2025
  48. Semantics of change IDs (Re: Gerrit, GitButler, and Jujutsu projects collaborating on change-id commit footer)Nico Williams, Apr 9, 2025
  49. Junio C HamanoApr 9, 2025
  50. Nico WilliamsApr 9, 2025
  51. Eric SunshineApr 9, 2025
  52. Nico WilliamsApr 9, 2025
  53. Theodore Ts'oApr 10, 2025
  54. Junio C HamanoApr 10, 2025
  55. Theodore Ts'oApr 11, 2025
  56. Konstantin RyabitsevApr 11, 2025
  57. Junio C HamanoApr 11, 2025
  58. Theodore Ts'oApr 12, 2025
  59. Junio C HamanoApr 14, 2025
  60. Remo SenekowitschApr 15, 2025
  61. Junio C HamanoApr 16, 2025
  62. Jacob KellerApr 16, 2025
  63. Jacob KellerApr 15, 2025
  64. D. Ben KnobleApr 14, 2025
  65. Nico WilliamsApr 14, 2025
  66. Jacob KellerApr 15, 2025
  67. Remo SenekowitschApr 16, 2025
  68. D. Ben KnobleApr 22, 2025
  69. Remo SenekowitschApr 22, 2025
  70. Junio C HamanoApr 22, 2025
  71. Remo SenekowitschApr 22, 2025
  72. Nico WilliamsApr 22, 2025
  73. Remo SenekowitschApr 22, 2025
  74. Nico WilliamsApr 23, 2025
  75. Remo SenekowitschApr 23, 2025
  76. Nico WilliamsApr 23, 2025
  77. Junio C HamanoApr 22, 2025
  78. Nico WilliamsApr 23, 2025
  79. Nico WilliamsApr 23, 2025
  80. Martin von ZweigbergkApr 23, 2025
  81. Junio C HamanoApr 23, 2025
  82. Martin von ZweigbergkApr 23, 2025
  83. Toon ClaesJun 6, 2025
  84. Remo SenekowitschApr 7, 2025
  85. Junio C HamanoApr 8, 2025
  86. Martin von ZweigbergkApr 8, 2025
  87. Junio C HamanoApr 8, 2025
  88. Phillip WoodApr 8, 2025
  89. Nico WilliamsApr 8, 2025
  90. Junio C HamanoApr 12, 2025
  91. Jacob KellerApr 16, 2025
  92. Kristoffer HaugsbakkMay 14, 2025
  93. Junio C HamanoApr 8, 2025
  94. Askar SafinAug 19, 2025
  95. Ben KnobleAug 19, 2025
  96. Remo SenekowitschApr 4, 2025
  97. Nico WilliamsApr 4, 2025
  98. Remo SenekowitschApr 4, 2025
  99. Nico WilliamsApr 4, 2025
  100. Remo SenekowitschApr 23, 2025
  101. Nico WilliamsApr 23, 2025
  102. How GitLab does/doesn't need change IDs (was Re: Semantics of change IDs)Toon Claes, Apr 23, 2025
  103. Nico WilliamsApr 23, 2025
  104. D. Ben KnobleMay 10, 2025
  105. D. Ben KnobleMay 10, 2025
  106. Martin von ZweigbergkMay 10, 2025
  107. Junio C HamanoMay 12, 2025
  108. Martin von ZweigbergkMay 12, 2025
  109. Junio C HamanoMay 14, 2025
  110. Oswald BuddenhagenMay 15, 2025
  111. Jacob KellerMay 15, 2025
  112. Junio C HamanoMay 15, 2025
  113. Nico WilliamsMay 15, 2025
  114. Martin von ZweigbergkMay 12, 2025
  115. brian m. carlsonMay 12, 2025
  116. Toon ClaesJun 6, 2025
  117. Junio C HamanoJun 6, 2025
  118. D. Ben KnobleMay 13, 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.