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

Re: [PATCH] sequencer: beautify subject of reverts of reverts

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 28, 2023, 14:00 UTC
Message-ID
<xmqq5yalj7qu.fsf@gitster.g>
In-Reply-To
<ZCLqbmWsN/7Ihjg+@ugly>
Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:
Show 8 quoted lines
>>That looks good. And the transformations are just:
>>
>>    Revert " → Reapply "
>>    Reapply " → Revert^3 "
>>    Revert^<n> " → Revert^<n+1> "
>>
> i thought about that already, and concluded that it's getting a bit
> "too nerdy" and over-engineered.

I agree that Revert^<n> looks too nerdy, and suspect that it was also one of the reasons why the old discussion thread died out, even though nobody in the thread explicitly mentioned it as the reason to reject it.

> ...
> but i don't mind, as long as `Revert "Revert "Revert "foo"""` cannot
> be argued to be canon any more.

At least, that form can be mechanically understood what it means with a single rule (i.e. "count the leading Revert"), instead of requiring a set of rules (i.e. "if it begins with Reapply, then that is reverted twice, count Reapply, multiply by two, and then add the number of Revert").

I personally prefer a format that conveys how things happened in a way that can be easily understood, over a format that looks pretty on surface but needs more special cases to understand what led to the outcome it represents. But because reverting a commit ought to be a rare event, and reverting a revert (or doing so recursively for more levels) ought to be even rarer, it shouldn't matter all that much either way how we phrase the reversion of a revert, or reversion of such a reversion.

There will be folks who will complain no matter how we change the way we phrase the reversion of a revert, while there may also be other folks who like the change we make, and I feel that it would not be worth my time to deal with the complaints for _this_ particular change that was proposed. As long as proponents for this change promise to handle all such complaints on and off list, I am fine with the change, though.

Having said all that, I think this change, if we were to apply, should be described in the documentation. Perhaps something along this line?

diff --git c/Documentation/git-revert.txt w/Documentation/git-revert.txt
index d2e10d3dce..d09311dd8a 100644
--- c/Documentation/git-revert.txt
+++ w/Documentation/git-revert.txt
@@ -31,6 +31,13 @@ both will discard uncommitted changes in your working directory.
 See "Reset, restore and revert" in linkgit:git[1] for the differences
 between the three commands.
 
+The command by default gives "Revert '<title>'" as the title to the
+resulting commit when reverting the original commit whose title is
+'<title>'.  A commit that reverts such a reversion commit is given
+"Reapply '<title>' as its title.  These can of course be edited in
+the editor when the reason for reverting is described.
+
+
 OPTIONS
 -------
 <commit>...::
Previous: Kristoffer HaugsbakkNext: Junio C Hamano
Message 7 of 8 in “sequencer: beautify subject of reverts of reverts”
  1. sequencer: beautify subject of reverts of revertsOswald Buddenhagen, Mar 23, 2023
  2. Kristoffer HaugsbakkMar 25, 2023
  3. Junio C HamanoMar 27, 2023
  4. Kristoffer HaugsbakkMar 28, 2023
  5. Oswald BuddenhagenMar 28, 2023
  6. Kristoffer HaugsbakkMar 28, 2023
  7. Junio C HamanoMar 28, 2023
  8. Junio C HamanoMar 28, 2023

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.