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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:27

Adam Monsen [off-list ref] 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.
 -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?

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

From: Adam Monsen <hidden>
Date: 2016-06-15 22:53:28

On 04/03/2012 02:55 PM, Junio C Hamano wrote:
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.
I like it!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help