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:26

Adam Monsen [off-list ref] writes:
...
* I don't know the kosher procedure to add this commit to your patch
  series for further review, so hopefully this works.
* I'm not sure if the "Helped-by:" lines are kosher, I'm happy to
  remove them if not.
One established way to do this is to have a discussion like the above
(mostly elided), followed by a "scissors" line "-- >8 --", and then the
output from format-patch with most headers except for "Subject: " removed
(as From: and Date: will be taken from your e-mailed message anyway, and
the first "From <commit object name> <magic constant date>" is a signal to
allow automated tools to tell if it is a format-patch output or a random
mbox file, and is not appropriate if you are sending it over e-mail).
From 91a62baa1fe89032e7a3598e5d39241f3eb8f84b Mon Sep 17 00:00:00 2001
From: Adam Monsen <redacted>
Date: Sat, 31 Mar 2012 12:09:29 -0700
Subject: [PATCH] git-commit.txt: clarify -t requires editing message

Make it clear that, when using commit --template, the message *must* be
changed or the commit will be aborted.


Helped-by: Junio C Hamano [off-list ref]
Helped-by: Ivan Heffner [off-list ref]
Signed-off-by: Adam Monsen <redacted>
---
I wrapped the text at 77 characters because that was the longest
line in the file (according to wc -L).

I used ":set noet nosta ts=8 sw=8 tw=77" in Vim.
When rewording or clarifying only a handful of words in the documentation,
it is often better to avoid reflowing lines in the same patch.  It makes
it harder to see what you really changed, and what is merely reflowed.

I'll queue it as-is, though.  Thanks.

This is a tangent, but we might want to rephrase the first sentence
without using the word "version"; every time I read this paragraph, the
"initial version" makes me go "Huh?" because the word sounds as if it is
talking about commits in the context of SCM, which is not the case here.

I know that the description wanted to avoid use of the word "template" to
explain what the template is, but still...
quoted hunk
 Documentation/git-commit.txt |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 5cc84a1..f584a62 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -132,11 +132,11 @@ OPTIONS
 
 -t <file>::
 --template=<file>::
-	Use the contents of the given file as the initial version
-	of the commit message. The editor is invoked and you can
-	make subsequent changes. If a message is specified using
-	the `-m` or `-F` options, this option has no effect. This
-	overrides the `commit.template` configuration variable.
+	Use the contents of the given file as the initial version of 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.
 
 -s::
 --signoff::

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

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

On 04/01/2012 03:28 PM, Junio C Hamano wrote:
One established way to do this is to have a discussion like the above
(mostly elided), followed by a "scissors" line...
I can do that. Thanks!
When rewording or clarifying only a handful of words in the documentation,
it is often better to avoid reflowing lines in the same patch.
I thought of that, but it made the right margin jagged. :)
My new suggestion (below) isolates the changes a bit better.
This is a tangent, but we might want to rephrase the first sentence
without using the word "version"; every time I read this paragraph, the
"initial version" makes me go "Huh?" because the word sounds as if it is
talking about commits in the context of SCM, which is not the case here.
Yeah, that bugs me too.

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.

-- >8 --
Subject: [PATCH v4] git-commit.txt: clarify -t requires editing message

Make it clear that, when using commit --template, the message *must* be
changed or the commit will be aborted.

Also, remove the words "initial version" to avoid confusion. Commit
messages are not versioned independently of commits.

Helped-by: Junio C Hamano [off-list ref]
Helped-by: Ivan Heffner [off-list ref]
Signed-off-by: Adam Monsen <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
Replaces b0ad5e27803cd of jc/commit-unedited-template. I'm assuming that's ok
since the branch isn't merged into maint or master.

 Documentation/git-commit.txt |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 5cc84a1..bd82431 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -132,9 +132,9 @@ OPTIONS
 
 -t <file>::
 --template=<file>::
-	Use the contents of the given file as the initial version
-	of the commit message. The editor is invoked and you can
-	make subsequent changes. If a message is specified using
+	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.
 
-- 
1.7.5.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help