git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Updating the commit message for reverts

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 24, 2019, 19:15 UTC
Message-ID
<xmqq7e2l5ych.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAEsQYpNtgMgwjVSOYB9vn-YPvKyKPZ2yZ3NigAVe3PztTN4v8w@mail.gmail.com>
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.
Previous: Gal PaikinNext: Gal Paikin
Message 2 of 8 in “Updating the commit message for reverts”
  1. Gal PaikinDec 24, 2019
  2. Junio C HamanoDec 24, 2019
  3. Gal PaikinDec 27, 2019
  4. Danh DoanDec 28, 2019
  5. Junio C HamanoDec 30, 2019
  6. Jonathan NiederDec 30, 2019
  7. Jonathan NiederDec 30, 2019
  8. Oswald BuddenhagenDec 30, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.