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

Re: Feature request: provide a persistent IDs on a commit

From
Elijah Newren <newren@gmail.com>
Date
Jul 24, 2022, 05:09 UTC
Message-ID
<CABPp-BHNYbLEWeG+XSzGxcTxsQ2wA2COX6DqtvVZ6Nm1KG7CEQ@mail.gmail.com>
In-Reply-To
<kl6lo7xmt8qw.fsf@chooglen-macbookpro.roam.corp.google.com>
On Mon, Jul 18, 2022 at 2:29 PM Glen Choo <chooglen@google.com> wrote:
Show 32 quoted lines
>
> Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
>
> > On Mon, Jul 18, 2022 at 06:18:11PM +0100, Stephen Finucane wrote:
> >> ...to track evolution of a patch through time.
> >>
> >> tl;dr: How hard would it be to retrofit an 'ChangeID' concept à la the 'Change-
> >> ID' trailer used by Gerrit into git core?
> >
> > I just started working on this for b4, with the notable difference that the
> > change-id trailer is used in the cover letter instead of in individual
> > commits, which moves the concept of "change" from a single commit to a series
> > of commits. IMO, it's much more useful in that scope, because as series are
> > reviewed and iterated, individual patches can get squashed, split up or
> > otherwise transformed.
>
> My 2 cents, since I used to use Gerrit a lot :)
>
> I find persistent per-commit ids really useful, even when patches get
> moved around. E.g. Gerrit can show and diff previous versions of the
> patch, which makes it really easy to tell how the patch has evolved
> over time.
>
> That's not to say that we don't need per-topic ids though ;) E.g. Gerrit
> is pretty bad at handling whole topics - it does naive mapping on a
> per-commit level, so it has no concept of "these (n - 1) patches should
> replace these n patches".
>
> I, for one, would love to see some kind of "rewrite tracking" in Git.
> One use case that comes up often is downstream patches, where patches
> are continuously rebased onto a new upstream; in those cases, it's
> pretty hard to keep track of how the patch has changed over time
Two angles I can think of that partially address this:
1) If you have the old commits still around and know what they were,
you can run range-diff to see differences between any pair of versions
of the commits.
2) cherry-picks and reverts might already include a link to an "old"
commit for you in the commit message ("cherry picked from commit
<hash>" or "This reverts <hash>").  Those could be used to show how
the new commit differs from what would have been done with an
automatic cherry-pick or automatic revert.  (By "automatic", I
basically mean what the state of files in the working tree would be
when the operation stops to allow users to resolve conflicts.)  In
fact, I wrote some patches to do precisely this quite a while ago
which are up at https://github.com/gitgitgadget/git/pull/1151 if
you're curious.  But this approach is not useful for general rebasing,
because there's no automated way to find out what the original commit
was so that you can take a look at such a difference.
Previous: Han-Wen NienhuysNext: Ævar Arnfjörð Bjarmason
Message 10 of 30 in “Feature request: provide a persistent IDs on a commit”
  1. Stephen FinucaneJul 18, 2022
  2. Konstantin RyabitsevJul 18, 2022
  3. Michal SuchánekJul 18, 2022
  4. Stephen FinucaneJul 19, 2022
  5. Glen ChooJul 18, 2022
  6. Konstantin RyabitsevJul 20, 2022
  7. Michal SuchánekJul 20, 2022
  8. Theodore Ts'oJul 20, 2022
  9. Han-Wen NienhuysJul 21, 2022
  10. Elijah NewrenJul 24, 2022
  11. Ævar Arnfjörð BjarmasonJul 18, 2022
  12. Stephen FinucaneJul 19, 2022
  13. Ævar Arnfjörð BjarmasonJul 19, 2022
  14. Michal SuchánekJul 19, 2022
  15. Stephen FinucaneJul 29, 2022
  16. Jason PyeronJul 29, 2022
  17. Phillip SusiJul 21, 2022
  18. Hilco WijbengaJul 21, 2022
  19. Philip OakleyJul 22, 2022
  20. Michal SuchánekJul 22, 2022
  21. Jacob KellerJul 22, 2022
  22. Michal SuchánekJul 23, 2022
  23. Elijah NewrenJul 24, 2022
  24. Michal SuchánekJul 24, 2022
  25. Jacob KellerJul 25, 2022
  26. Elijah NewrenJul 26, 2022
  27. Michal SuchánekJul 26, 2022
  28. Elijah NewrenJul 24, 2022
  29. Michal SuchánekJul 24, 2022
  30. Martin von ZweigbergkDec 15, 2024

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.