threads / discuss / 52514

Updating the commit message for reverts

Subject: Updating the commit message for reverts

## tl;dr

8 messages between Dec 24, 2019 and Dec 30, 2019.

replies: 7people: 5as markdown or json

Gal Paikin· Dec 24, 2019, 11:06 UTC · lore
Hi,

I work on the Gerrit team and I would like to change the default behavior for suggested commit messages for Reverts. 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.

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

I'm happy to change those things in Gerrit, but it would also be nice if it were changed inside of Git.

What do you think?

Thanks! Gal Paikin

Junio C Hamano· Dec 24, 2019, 19:15 UTC · re: Gal Paikin · lore

Re: Updating the commit message for reverts

Gal Paikin <paiking@google.com> writes:
Show 14 quoted lines
> I work on the Gerrit team and I would like to change the default
> behavior for suggested commit messages for Reverts.
> 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.
>
> The suggestion is to change the behavior to "Revert^N" instead of
> multiple Reverts one after another.
>
> I'm happy to change those things in Gerrit, but it would also be nice
> if it were changed inside of Git.
>
> What do you think?

I do not _think_ anybody lets the exact phrase 'Revert ...' in the log message to be read by scripts to perform machannical action, so in that sense it may be OK to special-case the reversion of a revert and rephrase it in a more human friendly way.

BUT
 * what does "Revert^47" even mean?  Not just the proposed phrasing
   looks horrible, it is not even clear what happened at the end.
   Was the patch turned out to be OK after all these reversion war,
   or got rejected for now?  It also misleads readers who know Git
   can perform a merge with more than two parents that it may be
   reverting the effect relative to 47th parent of the commit.
   It _might_ be slightly more acceptable to flip the phrase between
   "Revert X" and "Reinstate X" (or "Reapply X"), without saying
   "this is the 47th round of our reversion war".  I dunno.
 * how often does it happen in practice?  If a group of developers
   find themselves reverting and reapplying the same commit more
   than a few times, wouldn't they rather stop and think before
   doing yet another round, which I expect to result in a better fix
   implemented as a separate and brand new patch that takes
   inspiration from a patch that was earlier reverted, and at that
   point it won't be the 47th iteration of reversion war anyway.
So, I am fairly negative on the change in the proposed form as-is.
Gal Paikin· Dec 27, 2019, 10:13 UTC · re: Junio C Hamano · lore

Re: Updating the commit message for reverts

Hi, Thanks for the reply!

So the idea of changing from "Revert Revert" to "Reland", "reapply" has a big problem: sometimes Revert^2 actually means 'reverting "Revert"' since "Revert" introduced a bug that wasn't in the original change.

So to your question, I don't know what Revert^47 means since it depends on each individual case. Sometimes it actually means "Revert" and sometimes it means "Reland".

So do people actually use it? Yes! Many users reported to me that it is not that unusual to get to "Revert^6", and it is very usual and common to get to "Revert^2/3/4". It is also useful for the users to know the number of the revert, according to the reports. Here is an example: https://android-review.googlesource.com/c/platform/art/+/352330 Feel free to also search for "Revert^2/3/4" to find many results.

Anyway, I am certain that "Revert^3" is better than "Revert revert revert". There is definitely no clear way to solve this issue, but perhaps "nth revert" would be a more "human language" solution?

Best, Gal

On Tue, Dec 24, 2019 at 8:15 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 45 quoted lines
>
> Gal Paikin <paiking@google.com> writes:
>
> > I work on the Gerrit team and I would like to change the default
> > behavior for suggested commit messages for Reverts.
> > 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.
> >
> > The suggestion is to change the behavior to "Revert^N" instead of
> > multiple Reverts one after another.
> >
> > I'm happy to change those things in Gerrit, but it would also be nice
> > if it were changed inside of Git.
> >
> > What do you think?
>
> I do not _think_ anybody lets the exact phrase 'Revert ...' in the
> log message to be read by scripts to perform machannical action, so
> in that sense it may be OK to special-case the reversion of a revert
> and rephrase it in a more human friendly way.
>
> BUT
>
>  * what does "Revert^47" even mean?  Not just the proposed phrasing
>    looks horrible, it is not even clear what happened at the end.
>    Was the patch turned out to be OK after all these reversion war,
>    or got rejected for now?  It also misleads readers who know Git
>    can perform a merge with more than two parents that it may be
>    reverting the effect relative to 47th parent of the commit.
>
>    It _might_ be slightly more acceptable to flip the phrase between
>    "Revert X" and "Reinstate X" (or "Reapply X"), without saying
>    "this is the 47th round of our reversion war".  I dunno.
>
>  * how often does it happen in practice?  If a group of developers
>    find themselves reverting and reapplying the same commit more
>    than a few times, wouldn't they rather stop and think before
>    doing yet another round, which I expect to result in a better fix
>    implemented as a separate and brand new patch that takes
>    inspiration from a patch that was earlier reverted, and at that
>    point it won't be the 47th iteration of reversion war anyway.
>
> So, I am fairly negative on the change in the proposed form as-is.
Danh Doan· Dec 28, 2019, 13:20 UTC · re: Gal Paikin · lore

Re: Updating the commit message for reverts

On 2019-12-27 11:13:47+0100, Gal Paikin <paiking@google.com> wrote:
Show 14 quoted lines
> Hi,
> Thanks for the reply!
> 
> So the idea of changing from "Revert Revert" to "Reland", "reapply"
> has a big problem: sometimes Revert^2 actually means 'reverting
> "Revert"' since "Revert" introduced a bug that wasn't in the original
> change.
> 
> So to your question, I don't know what Revert^47 means since it
> depends on each individual case. Sometimes it actually means "Revert"
> and sometimes it means "Reland".
> 
> So do people actually use it? Yes! Many users reported to me that it
> is not that unusual to get to "Revert^6", and it is very usual and

I've seen Revert x6 in a code base, I couldn't get to know the reason for that reversion war. I think it could be seen more in some in-house web development that uses trunk-based development, code is being tested with CI/CD, lightly tested, squash-merged to master, then run into problem in staging (or worst, production, because not enough traffix was generated for testing environment).

Show 9 quoted lines
> common to get to "Revert^2/3/4". It is also useful for the users to
> know the number of the revert, according to the reports. Here is an
> example:
> https://android-review.googlesource.com/c/platform/art/+/352330
> Feel free to also search for "Revert^2/3/4" to find many results.
> 
> Anyway, I am certain that "Revert^3" is better than "Revert revert
> revert". There is definitely no clear way to solve this issue, but
> perhaps "nth revert" would be a more "human language" solution?

In my very personal opinion, "nth revert" is a poor choice. At a first glance, I would take it as:

	This is the "nth revert", after applying this patch n times.
-- 
Danh
Junio C Hamano· Dec 30, 2019, 16:52 UTC · re: Gal Paikin · lore

Re: Updating the commit message for reverts

Gal Paikin <paiking@google.com> writes:
> So the idea of changing from "Revert Revert" to "Reland", "reapply"
> has a big problem: sometimes Revert^2 actually means 'reverting
> "Revert"' since "Revert" introduced a bug that wasn't in the original
> change.

Sorry, I do not see a relevance of the above in this discussion, as the situation does not improve if you phrase it as "Revert^2" or "Second Revert".

Also as somebody else said in downthread, the phrasing "second revert" would typically mean "a patch gets applied, proves to be premature and gets reverted, the revert is reverted because the situation in the rest of the system improved to make the orignal patch viable, and then gets reverted again due to some other issues", i.e. "Revert Revert Revert do something", so it is even worse.

Jonathan Nieder· Dec 30, 2019, 19:55 UTC · re: Gal Paikin · lore

Re: Updating the commit message for reverts

(also cc-ing the Gerrit list. The git mailing list requires plain-text
 email and prefers bottom-posting; there shouldn't be any other
 gotchas if you reply-all)
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

Jonathan Nieder· Dec 30, 2019, 19:59 UTC · re: Gal Paikin · lore

Re: Updating the commit message for reverts

(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

Oswald Buddenhagen· Dec 30, 2019, 20:33 UTC · re: Jonathan Nieder · lore

Re: Updating the commit message for reverts

On Mon, Dec 30, 2019 at 11:59:15AM -0800, Jonathan Nieder wrote:
Show 9 quoted lines
>Gal Paikin wrote:
>> 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: [...]
>

the irony here is that "reland" is of course yet more jargon. :-D i'd strongly suggest to use something that actually appears in standard dictionaries, preferentially "reapply".

Show 10 quoted lines
> 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 principle i agree, but it irks me somewhat that the summaries become non-unique, as that always somewhat impacts history browsing.

← back to recent threads