git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Updating the commit message for reverts
@ 2019-12-24 11:06 Gal Paikin
  2019-12-24 19:15 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Gal Paikin @ 2019-12-24 11:06 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Updating the commit message for reverts
  2019-12-24 11:06 Updating the commit message for reverts Gal Paikin
@ 2019-12-24 19:15 ` Junio C Hamano
  2019-12-27 10:13   ` Gal Paikin
  2019-12-30 19:55 ` Jonathan Nieder
  2019-12-30 19:59 ` Jonathan Nieder
  2 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2019-12-24 19:15 UTC (permalink / raw)
  To: Gal Paikin; +Cc: git

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Updating the commit message for reverts
  2019-12-24 19:15 ` Junio C Hamano
@ 2019-12-27 10:13   ` Gal Paikin
  2019-12-28 13:20     ` Danh Doan
  2019-12-30 16:52     ` Junio C Hamano
  0 siblings, 2 replies; 8+ messages in thread
From: Gal Paikin @ 2019-12-27 10:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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:
>
> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Updating the commit message for reverts
  2019-12-27 10:13   ` Gal Paikin
@ 2019-12-28 13:20     ` Danh Doan
  2019-12-30 16:52     ` Junio C Hamano
  1 sibling, 0 replies; 8+ messages in thread
From: Danh Doan @ 2019-12-28 13:20 UTC (permalink / raw)
  To: Gal Paikin; +Cc: Junio C Hamano, git

On 2019-12-27 11:13:47+0100, Gal Paikin <paiking@google.com> wrote:
> 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).

> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Updating the commit message for reverts
  2019-12-27 10:13   ` Gal Paikin
  2019-12-28 13:20     ` Danh Doan
@ 2019-12-30 16:52     ` Junio C Hamano
  1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2019-12-30 16:52 UTC (permalink / raw)
  To: Gal Paikin; +Cc: git

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Updating the commit message for reverts
  2019-12-24 11:06 Updating the commit message for reverts Gal Paikin
  2019-12-24 19:15 ` Junio C Hamano
@ 2019-12-30 19:55 ` Jonathan Nieder
  2019-12-30 19:59 ` Jonathan Nieder
  2 siblings, 0 replies; 8+ messages in thread
From: Jonathan Nieder @ 2019-12-30 19:55 UTC (permalink / raw)
  To: Gal Paikin; +Cc: git, repo-discuss, ajp

(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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Updating the commit message for reverts
  2019-12-24 11:06 Updating the commit message for reverts Gal Paikin
  2019-12-24 19:15 ` Junio C Hamano
  2019-12-30 19:55 ` Jonathan Nieder
@ 2019-12-30 19:59 ` Jonathan Nieder
  2019-12-30 20:33   ` Oswald Buddenhagen
  2 siblings, 1 reply; 8+ messages in thread
From: Jonathan Nieder @ 2019-12-30 19:59 UTC (permalink / raw)
  To: Gal Paikin; +Cc: git, ajp, Oswald Buddenhagen, Nasser Grainawi

(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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Updating the commit message for reverts
  2019-12-30 19:59 ` Jonathan Nieder
@ 2019-12-30 20:33   ` Oswald Buddenhagen
  0 siblings, 0 replies; 8+ messages in thread
From: Oswald Buddenhagen @ 2019-12-30 20:33 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Gal Paikin, git, ajp, Nasser Grainawi

On Mon, Dec 30, 2019 at 11:59:15AM -0800, Jonathan Nieder wrote:
>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".

> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-12-30 20:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24 11:06 Updating the commit message for reverts Gal Paikin
2019-12-24 19:15 ` Junio C Hamano
2019-12-27 10:13   ` Gal Paikin
2019-12-28 13:20     ` Danh Doan
2019-12-30 16:52     ` Junio C Hamano
2019-12-30 19:55 ` Jonathan Nieder
2019-12-30 19:59 ` Jonathan Nieder
2019-12-30 20:33   ` Oswald Buddenhagen

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).