Thread (4 messages) 4 messages, 3 authors, 2019-12-30

Re: Updating the commit message for reverts

From: Jonathan Nieder <hidden>
Date: 2019-12-30 19:59:19

(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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help