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

Re: [PATCH] git-commit: add --verbatim to allow unstripped commit messages

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Dec 21, 2007, 00:49 UTC
Message-ID
<alpine.LFD.0.9999.0712201645020.21557@woody.linux-foundation.org>
In-Reply-To
<20071221001449.GA10607@atjola.homenet>
On Fri, 21 Dec 2007, Bj?rn Steinbrink wrote:
Show 6 quoted lines
> 
> Hm, this is a bit more intrusive, but should catch most cases.
> 
> At the top of the comments in the commit message template add:
> #GIT CUT HERE
> (And adjust the descriptive text)

Ouch. I'd personally hate to see something like that at the top and then have to save it. I always add my text to the top of the message, and all the pre-made messages for me are at the top (ie the kinds you get with "git commit --amend", where the top of the thing is the old message).

That said, I might well agree with this approach if we made the marker line be the *last* line of the message, ie make it be something that ends with (ignoring empty whitespace at the end, of course, since those are invisible in most editors):

	# Remove this line to keep all comment lines
or something like that.

That still keeps the question about whitespace cleanups. But if it's just about whitespace or no whitespace, then a simple "--verbatim" flag would work.

			Linus
Previous: Björn SteinbrinkNext: Junio C Hamano
Message 12 of 23 in “git-commit: add --verbatim to allow unstripped commit messages”
  1. git-commit: add --verbatim to allow unstripped commit messagesAlex Riesen, Dec 20, 2007
  2. Linus TorvaldsDec 20, 2007
  3. Alex RiesenDec 20, 2007
  4. git-commit: add --verbatim to allow unstripped commit messagesAlex Riesen, Dec 20, 2007
  5. Only filter "#" comments from commits if the editor is usedAlex Riesen, Dec 20, 2007
  6. Junio C HamanoDec 20, 2007
  7. Alex RiesenDec 20, 2007
  8. Junio C HamanoDec 20, 2007
  9. Fix thinko in checking for commit message emptinessAlex Riesen, Dec 20, 2007
  10. Linus TorvaldsDec 20, 2007
  11. Björn SteinbrinkDec 21, 2007
  12. Linus TorvaldsDec 21, 2007
  13. Junio C HamanoDec 20, 2007
  14. Linus TorvaldsDec 21, 2007
  15. Allow selection of different cleanup modes for commit messagesAlex Riesen, Dec 21, 2007
  16. Junio C HamanoDec 21, 2007
  17. Allow selection of different cleanup modes for commit messagesAlex Riesen, Dec 21, 2007
  18. Junio C HamanoDec 22, 2007
  19. Allow selection of different cleanup modes for commit messagesAlex Riesen, Dec 22, 2007
  20. Linus TorvaldsDec 22, 2007
  21. Junio C HamanoDec 22, 2007
  22. Junio C HamanoDec 23, 2007
  23. Junio C HamanoDec 23, 2007

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.