Documentation: describe subject more precisely
The discussion of email subject throughout the documentation is misleading; it indicates that the first line will always become the subject. In fact, the subject is generally all lines up until the first full blank line. This patch refines that, and makes more use of the concept of a commit title, with the title being all text up to the first blank line. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeremy White committed
Sep 13, 2012 at 17:27 UTC
52ffe995b9a3fc43de8eca80bedab2e055aac562
7 files changed
+31
-22
Documentation/git-commit.txt
+4
-2
@@ -389,8 +389,10 @@ DISCUSSION
389
Though not required, it's a good idea to begin the commit message
390
with a single short (less than 50 character) line summarizing the
391
change, followed by a blank line and then a more thorough description.
392
-Tools that turn commits into email, for example, use the first line
393
-on the Subject: line and the rest of the commit in the body.
392
+The text up to the first blank line in a commit message is treated
393
+as the commit title, and that title is used throughout git.
394
+For example, linkgit:git-format-patch[1] turns a commit into email, and it uses
395
+the title on the Subject line and the rest of the commit in the body.
396
397
include::i18n.txt[]
398
Documentation/git-for-each-ref.txt
+4
-3
@@ -102,9 +102,10 @@ Fields that have name-email-date tuple as its value (`author`,
102
and `date` to extract the named component.
103
104
The complete message in a commit and tag object is `contents`.
105
-Its first line is `contents:subject`, the remaining lines
106
-are `contents:body` and the optional GPG signature
107
-is `contents:signature`.
105
+Its first line is `contents:subject`, where subject is the concatenation
106
+of all lines of the commit message up to the first blank line. The next
107
+line is 'contents:body', where body is all of the lines after the first
108
+blank line. Finally, the optional GPG signature is `contents:signature`.
109
110
For sorting purposes, fields with numeric values sort in numeric
111
order (`objectsize`, `authordate`, `committerdate`, `taggerdate`).
Documentation/git-format-patch.txt
+7
-4
@@ -58,10 +58,13 @@ output, unless the `--stdout` option is specified.
58
If `-o` is specified, output files are created in <dir>. Otherwise
59
they are created in the current working directory.
60
61
-By default, the subject of a single patch is "[PATCH] First Line" and
62
-the subject when multiple patches are output is "[PATCH n/m] First
63
-Line". To force 1/1 to be added for a single patch, use `-n`. To omit
64
-patch numbers from the subject, use `-N`.
61
+By default, the subject of a single patch is "[PATCH] " followed by
62
+the concatenation of lines from the commit message up to the first blank
63
+line (see the DISCUSSION section of linkgit:git-commit[1]).
64
+
65
+When multiple patches are output, the subject prefix will instead be
66
+"[PATCH n/m] ". To force 1/1 to be added for a single patch, use `-n`.
67
+To omit patch numbers from the subject, use `-N`.
68
69
If given `--thread`, `git-format-patch` will generate `In-Reply-To` and
70
`References` headers to make the second and subsequent patch mails appear
Documentation/git-shortlog.txt
+1
-2
@@ -14,8 +14,7 @@ git log --pretty=short | 'git shortlog' [-h] [-n] [-s] [-e] [-w]
14
DESCRIPTION
15
-----------
16
Summarizes 'git log' output in a format suitable for inclusion
17
-in release announcements. Each commit will be grouped by author and
18
-the first line of the commit message will be shown.
17
+in release announcements. Each commit will be grouped by author and title.
18
19
Additionally, "[PATCH]" will be stripped from the commit description.
20
Documentation/gitcore-tutorial.txt
+4
-5
@@ -956,12 +956,11 @@ $ git show-branch --topo-order --more=1 master mybranch
956
------------------------------------------------
957
958
The first two lines indicate that it is showing the two branches
959
-and the first line of the commit log message from their
960
-top-of-the-tree commits, you are currently on `master` branch
961
-(notice the asterisk `*` character), and the first column for
962
-the later output lines is used to show commits contained in the
959
+with the titles of their top-of-the-tree commits, you are currently on
960
+`master` branch (notice the asterisk `*` character), and the first
961
+column for the later output lines is used to show commits contained in the
962
`master` branch, and the second column for the `mybranch`
964
-branch. Three commits are shown along with their log messages.
963
+branch. Three commits are shown along with their titles.
964
All of them have non blank characters in the first column (`*`
965
shows an ordinary commit on the current branch, `-` is a merge commit), which
966
means they are now part of the `master` branch. Only the "Some
Documentation/gittutorial.txt
+5
-3
@@ -139,9 +139,11 @@ them to the index, and commit, all in one step.
139
A note on commit messages: Though not required, it's a good idea to
140
begin the commit message with a single short (less than 50 character)
141
line summarizing the change, followed by a blank line and then a more
142
-thorough description. Tools that turn commits into email, for
143
-example, use the first line on the Subject: line and the rest of the
144
-commit in the body.
142
+thorough description. The text up to the first blank line in a commit
143
+message is treated as the commit title, and that title is used
144
+throughout git. For example, linkgit:git-format-patch[1] turns a
145
+commit into email, and it uses the title on the Subject line and the
146
+rest of the commit in the body.
147
148
Git tracks content not files
149
----------------------------
Documentation/user-manual.txt
+6
-3
@@ -1136,9 +1136,12 @@ Creating good commit messages
1136
Though not required, it's a good idea to begin the commit message
1137
with a single short (less than 50 character) line summarizing the
1138
change, followed by a blank line and then a more thorough
1139
-description. Tools that turn commits into email, for example, use
1140
-the first line on the Subject line and the rest of the commit in the
1141
-body.
1139
+description. The text up to the first blank line in a commit
1140
+message is treated as the commit title, and that title is used
1141
+throughout git. For example, linkgit:git-format-patch[1] turns a
1142
+commit into email, and it uses the title on the Subject line and the
1143
+rest of the commit in the body.
1144
+
1145
1146
[[ignoring-files]]
1147
Ignoring files