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

Re: [PATCH 0/3] "commit --template" fixes

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 3, 2012, 21:55 UTC
Message-ID
<7v1uo4cwg7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4F7B2F35.40807@gmail.com>
Adam Monsen <haircut@gmail.com> writes:
> How about this? I'm a little bummed it doesn't include why commit
> --template exists at all, but it reads well: terse and to the point like
> (IMHO) a manpage should.

Perhaps we should explain why somebody might want to use --template instead of -F; personally, I do not think --template command line option would not make much sense unless it is used as a part of a script that enforces external constraints in a larger workflow, even though such a project could instead require the participants to set commit.template to one supplied by the project. As an enforcement mechanism, use of such stricter "commit wrapper" and commit.template configuration cannot be mechanical and absolute either way, as Git is distributed and whatever happens in the participant's repository is purely up to the participant.

Show 7 quoted lines
>  -t <file>::
>  --template=<file>::
> +	Use the contents of the given file as the commit message. The
> +	editor is invoked so you can make subsequent changes. If you make no
> +	changes, the commit is aborted. If a message is specified using
>  	the `-m` or `-F` options, this option has no effect. This
>  	overrides the `commit.template` configuration variable.

When editing the commit message, start the editor with the contents in the given file. The `commit.template` configuration variable is often used to give this option implicitly to the command. This mechanism can be used by projects that want to guide participants with some hints on what to write in the message in what order. If the user exits the editor without editing the message, the commit is aborted. This has no effect when a message is given by other means, e.g. with the `-m` or `-F` options.

Hmm?
Previous: Adam MonsenNext: Adam Monsen
Message 18 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.