git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Glen Choo <chooglen@google.com>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	Stephen Finucane <stephen@that.guru>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Feature request: provide a persistent IDs on a commit
Date: Sat, 23 Jul 2022 22:09:02 -0700	[thread overview]
Message-ID: <CABPp-BHNYbLEWeG+XSzGxcTxsQ2wA2COX6DqtvVZ6Nm1KG7CEQ@mail.gmail.com> (raw)
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:
>
> 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.

  parent reply	other threads:[~2022-07-24  5:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 17:18 Feature request: provide a persistent IDs on a commit Stephen Finucane
2022-07-18 17:35 ` Konstantin Ryabitsev
2022-07-18 19:04   ` Michal Suchánek
2022-07-19 10:57     ` Stephen Finucane
2022-07-18 21:24   ` Glen Choo
2022-07-20 19:21     ` Konstantin Ryabitsev
2022-07-20 19:30       ` Michal Suchánek
2022-07-20 22:10       ` Theodore Ts'o
2022-07-21 11:57         ` Han-Wen Nienhuys
2022-07-24  5:09     ` Elijah Newren [this message]
2022-07-18 18:50 ` Ævar Arnfjörð Bjarmason
2022-07-19 10:47   ` Stephen Finucane
2022-07-19 11:09     ` Ævar Arnfjörð Bjarmason
2022-07-19 11:57       ` Michal Suchánek
2022-07-29 12:11       ` Stephen Finucane
2022-07-29 12:40         ` Jason Pyeron
2022-07-21 16:18   ` Phillip Susi
2022-07-21 18:58     ` Hilco Wijbenga
2022-07-22 20:08       ` Philip Oakley
2022-07-22 20:36         ` Michal Suchánek
2022-07-22 22:46           ` Jacob Keller
2022-07-23  7:00             ` Michal Suchánek
2022-07-24  5:23               ` Elijah Newren
2022-07-24  8:54                 ` Michal Suchánek
2022-07-25 21:47                 ` Jacob Keller
2022-07-26  3:49                   ` Elijah Newren
2022-07-26  8:43                     ` Michal Suchánek
2022-07-24  5:10           ` Elijah Newren
2022-07-24  8:59             ` Michal Suchánek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPp-BHNYbLEWeG+XSzGxcTxsQ2wA2COX6DqtvVZ6Nm1KG7CEQ@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=stephen@that.guru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).