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

Re: [PATCH v2] git-commit.txt: clarify -t requires editing message

From
Adam Monsen <haircut@gmail.com>
Date
Mar 30, 2012, 04:53 UTC
Message-ID
<4F753C3F.7010805@gmail.com>
In-Reply-To
<7vr4waoics.fsf@alter.siamese.dyndns.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Junio C Hamano wrote:
> You still say "the message is considered empty and" but I think it
>  probably reads better without it.
Do you like the patch without those words?
> Strictly speaking, it is not a "mandatory fillable form", but 
> whatever text you put in the template is advisory to the users.

Ok, right on. I understand the template feature now since you've patiently explained it to me (thank you!). I still want to plainly convey that even if my template is the following:

	~~~~
	zip module: continue to expand transformer
	
	This WIP will eventually provide expanded
	transformer functionality.
	~~~~
I *cannot* just save and quit my editor (unless I supply
- --allow-empty-message). That's the behavior I find confusing: git
telling me a non-empty commit message is an empty commit message. If I
save that text above (zip module... etc) in FILE and do `git commit -t
FILE`, save and quit my editor, git says "Aborting commit due to empty
commit message." Lies! A more precise message would be "Aborting
commit due to unmodified commit message template."

Based on the current documentation I misunderstood that -t could be used to review a boilerplate commit message and save it verbatim.

...AHA! I just figured out a way to do exactly that:
	git commit --edit --file=FILE
aka
	git commit -eF FILE
Yay! No idea how I missed that before.
Anyway, it still seems like the documentation for "git commit -t"
could use improvement. I actually wouldn't mind seeing a short example
template like the one you provided, maybe in the EXAMPLES or
DISCUSSION section.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJPdTw/AAoJEJtdmT+DbynAte4IALRx50yW5bEfzXskvSDewPuL SgaU4CqUHRm8sWXHeFbd4I2rG4dEJuqYqzKKbfay3EMwEbIkThiwoC2pJ9xJoFpe 8O95GVp3ikYvsY3mn87ebiwA9FBhnTy1Fz+MREfuzETpJbdtJSHhbRXMxfJ9ZabU FOPE/qeZDvQJA9b9QFY3QS/BcxsGHXhW9xCULZlAprDggMcchhHDEbqJCh/1wObw cQvoONiqZSkXA17K3gxfs7NgafUVFIg3+N9vcq90eZXbT/s1MM+1zxj5ezTh9jbV sOkzepfE5+NBK3PnewMDxDxhF0LD5lzHCwnfkTl1Om3okSE0nxVyRZKabuzc99s= =NUN8 -----END PGP SIGNATURE-----

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 19 in “git-commit doc: say -t requires editing commit message”
  1. git-commit doc: say -t requires editing commit messageAdam Monsen, Mar 29, 2012
  2. Ivan HeffnerMar 29, 2012
  3. git-commit.txt: clarify -t requires editing messageAdam Monsen, Mar 29, 2012
  4. Junio C HamanoMar 30, 2012
  5. Adam MonsenMar 30, 2012
  6. Junio C HamanoMar 30, 2012
  7. Adam MonsenMar 30, 2012
  8. Junio C HamanoMar 30, 2012
  9. Adam MonsenMar 30, 2012
  10. Junio C HamanoMar 30, 2012
  11. 0/3 "commit --template" fixesJunio C Hamano, Mar 30, 2012
  12. 1/3 t7501: test the right kind of breakageJunio C Hamano, Mar 30, 2012
  13. 2/3 commit: do not trigger bogus "has templated message edited" checkJunio C Hamano, Mar 30, 2012
  14. 3/3 commit: rephrase the error when user did not touch templated log messageJunio C Hamano, Mar 30, 2012
  15. Adam MonsenMar 31, 2012
  16. Junio C HamanoApr 1, 2012
  17. Adam MonsenApr 3, 2012
  18. Junio C HamanoApr 3, 2012
  19. Adam MonsenApr 5, 2012

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.