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

Re: [PATCH] revert: optionally refer to commit in the "reference" format

From
Junio C Hamano <gitster@pobox.com>
Date
May 23, 2022, 22:37 UTC
Message-ID
<xmqqy1yrnado.fsf@gitster.g>
In-Reply-To
<220523.86wnecxqol.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 9 quoted lines
>> +		if (!opts->commit_use_reference) {
>> +			strbuf_addstr(&msgbuf, "Revert \"");
>> +			strbuf_addstr(&msgbuf, msg.subject);
>> +			strbuf_addstr(&msgbuf, "\"");
>> +		} else {
>> +			strbuf_addstr(&msgbuf, "DESCRIBE WHY WE ARE REVERTING HERE");
>
> Having seen how people use git in the wild, this *WILL* result in a
> bunch of history where people don't edit that at all.

It was done very much on purpose. A pressure from other project participants against the ugly all caps content-free message will help instill better behaviour. A solo developer also will learn after making reverts with content-free titles (and if they do not find it inconvenient for their development purpose that their history is full of content-free titles shouting in all caps, then more power to them---if they are happy, we are happy, too).

If we leave something like
	# Add one line above and explain not *what* this revert did,
	# but *why* you decided to revert in 50-70 chars.  Did it
	# break something? Was it premature?
	This reverts commit 8aa3f0dc (CI: set CC in MAKEFLAGS directly, 2022-04-21)

presumably, stripspace will make the "This reverts commit ..." the title of the reverted commit. It would invite people not to edit it out out of laziness. Since the whole point of this change is to encourage people to describe the reason behind the revert on the subject line, such an invitation is counter-productive.

Doing the first two lines like so:
	Revert 8aa3f0dc (CI: set CC in MAKEFLAGS directly, 2022-04-21)
	# Edit the above line to explain not *what* this revert did,
would have pretty much the same effect, I am afraid.
So...
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 14 of 20 in “revert: optionally refer to commit in the "reference" format”
  1. revert: optionally refer to commit in the "reference" formatJunio C Hamano, May 22, 2022
  2. Johannes SchindelinMay 23, 2022
  3. Junio C HamanoMay 23, 2022
  4. revert: optionally refer to commit in the "reference" formatJunio C Hamano, May 27, 2022
  5. Johannes SchindelinMay 30, 2022
  6. Phillip WoodMay 31, 2022
  7. Junio C HamanoJun 1, 2022
  8. Phillip WoodJun 1, 2022
  9. Ævar Arnfjörð BjarmasonJun 1, 2022
  10. Junio C HamanoJun 1, 2022
  11. Side effects in Git's test suite, was Re: [PATCH] revert: optionally refer to commit in the "reference" formatJohannes Schindelin, May 30, 2022
  12. Ævar Arnfjörð BjarmasonMay 31, 2022
  13. Ævar Arnfjörð BjarmasonMay 23, 2022
  14. Junio C HamanoMay 23, 2022
  15. Ævar Arnfjörð BjarmasonMay 24, 2022
  16. Junio C HamanoMay 24, 2022
  17. Phillip WoodMay 26, 2022
  18. Junio C HamanoMay 26, 2022
  19. René ScharfeJun 26, 2022
  20. Junio C HamanoJun 27, 2022

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.