Re: Updating the commit message for reverts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(not cc-ing the Gerrit list after all, since only members can post)
Hi Gal,

Gal Paikin wrote:

> I work on the Gerrit team and I would like to change the default
> behavior for suggested commit messages for Reverts.

Thanks for writing.  I like it when tools behave consistently with one
another, so I'm glad you brought it up here.

> Currently, if the user is trying a change called '"Revert "change X"',
> the suggested commit message would be 'Revert "Revert "Change X""'
> which is silly, since sometimes users want to revert the same change
> many times.

For context, [1] is where this was discussed previously on the Gerrit
mailing list.  Do you have more context?  For example, have there been
reports from users requesting this kind of change?

For a bit of precedent, the Chromium project has some custom logic[2]
that rewrites a revert of a revert to "Reland".  I kind of like that,
since it makes the intention behind the revert-of-revert a little
clearer.

If both reverts are clean, then the typical use case I can think of is
that a prerequisite was missing, hence the revert; after all the
prerequisites were in place, it was then safe to roll forward, hence
the reland.  I would hope that the full commit messages for these
revert commits would provide this context since without that kind of
communication from the people involved, a reader is lost.

> The suggestion is to change the behavior to "Revert^N" instead of
> multiple Reverts one after another.

This would be replacing one kind of jargon with another, so it's not
clear to me that it would improve matters.

With Revert / Reland, we can forget the N altogether:

 1. 'Do some great thing'
 2. 'Revert "Do some great thing"'
 3. 'Reland "Do some great thing"'
 4. 'Revert "Do some great thing"'
 5. (etc)

For the reader of the shortlog, it's not too important how long the
edit war has gone.  The single word makes it clear what the commit
is going to do.

In the full commit message, I would hope that people put in some
explanation of the story so far to explain why they have gone
back-and-forth all these times.

Thanks and hope that helps,
Jonathan

[1] https://groups.google.com/d/msg/repo-discuss/edl43LcyEKE/f9Q65kOcBgAJ
[2] https://chromium-review.googlesource.com/c/infra/gerrit-plugins/chromium-behavior/+/757684



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux