Skip to content

Commit 94f15fe

Browse files
Linus Arvergitster
authored andcommitted
doc: trailer: drop "commit message part" phrasing
The command can take inputs that are either just a commit message, or an email-like output such as git-format-patch which includes a commit message, "---" divider, and patch part. The existing explanation blends these two inputs together in the first sentence This command reads some patches or commit messages which then necessitates using the "commit message part" phrasing (as opposed to just "commit message") because the input is ambiguous per the above definition. This change separates the two input types and explains them separately, and so there is no longer a need to use the "commit message part" phrase. Signed-off-by: Linus Arver <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 00432a3 commit 94f15fe

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

Documentation/git-interpret-trailers.txt

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,31 @@ Add or parse 'trailer' lines that look similar to RFC 822 e-mail
1818
headers, at the end of the otherwise free-form part of a commit
1919
message.
2020

21-
This command reads some patches or commit messages from either the
22-
<file> arguments or the standard input if no <file> is specified. If
23-
`--parse` is specified, the output consists of the parsed trailers.
24-
21+
This command reads commit messages from either the
22+
<file> arguments or the standard input if no <file> is specified.
23+
If `--parse` is specified, the output consists of the parsed trailers.
2524
Otherwise, this command applies the arguments passed using the
26-
`--trailer` option, if any, to the commit message part of each input
27-
file. The result is emitted on the standard output.
25+
`--trailer` option, if any, to each input file. The result is emitted on the
26+
standard output.
27+
28+
This command can also operate on the output of linkgit:git-format-patch[1],
29+
which is more elaborate than a plain commit message. Namely, such output
30+
includes a commit message (as above), a "---" divider line, and a patch part.
31+
For these inputs, the divider and patch parts are not modified by
32+
this command and are emitted as is on the output, unless
33+
`--no-divider` is specified.
2834

2935
Some configuration variables control the way the `--trailer` arguments
30-
are applied to each commit message and the way any existing trailer in
31-
the commit message is changed. They also make it possible to
36+
are applied to each input and the way any existing trailer in
37+
the input is changed. They also make it possible to
3238
automatically add some trailers.
3339

3440
By default, a '<token>=<value>' or '<token>:<value>' argument given
3541
using `--trailer` will be appended after the existing trailers only if
3642
the last trailer has a different (<token>, <value>) pair (or if there
3743
is no existing trailer). The <token> and <value> parts will be trimmed
3844
to remove starting and trailing whitespace, and the resulting trimmed
39-
<token> and <value> will appear in the message like this:
45+
<token> and <value> will appear in the output like this:
4046

4147
------------------------------------------------
4248
token: value
@@ -47,19 +53,17 @@ This means that the trimmed <token> and <value> will be separated by
4753

4854
By default the new trailer will appear at the end of all the existing
4955
trailers. If there is no existing trailer, the new trailer will appear
50-
after the commit message part of the output, and, if there is no line
51-
with only spaces at the end of the commit message part, one blank line
52-
will be added before the new trailer.
56+
at the end of the input. A blank line will be added before the new
57+
trailer if there isn't one already.
5358

54-
Existing trailers are extracted from the input message by looking for
59+
Existing trailers are extracted from the input by looking for
5560
a group of one or more lines that (i) is all trailers, or (ii) contains at
5661
least one Git-generated or user-configured trailer and consists of at
5762
least 25% trailers.
5863
The group must be preceded by one or more empty (or whitespace-only) lines.
59-
The group must either be at the end of the message or be the last
64+
The group must either be at the end of the input or be the last
6065
non-whitespace lines before a line that starts with '---' (followed by a
61-
space or the end of the line). Such three minus signs start the patch
62-
part of the message. See also `--no-divider` below.
66+
space or the end of the line).
6367

6468
When reading trailers, there can be no whitespace before or inside the
6569
token, but any number of regular space and tab characters are allowed

0 commit comments

Comments
 (0)