Skip to content

Commit d57fa7f

Browse files
Linus Arvergitster
authored andcommitted
doc: trailer: add more examples in DESCRIPTION
Be more up-front about what trailers are in practice with examples, to give the reader a visual cue while they go on to read the rest of the description. Also add an example for multiline values. Signed-off-by: Linus Arver <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eda2c44 commit d57fa7f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Documentation/git-interpret-trailers.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@ DESCRIPTION
1616
-----------
1717
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
19-
message.
19+
message. For example, in the following commit message
20+
21+
------------------------------------------------
22+
subject
23+
24+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
25+
26+
Signed-off-by: Alice <[email protected]>
27+
Signed-off-by: Bob <[email protected]>
28+
------------------------------------------------
29+
30+
the last two lines starting with "Signed-off-by" are trailers.
2031

2132
This command reads commit messages from either the
2233
<file> arguments or the standard input if no <file> is specified.
@@ -73,7 +84,12 @@ When reading trailers, there can be no whitespace before or inside the
7384
between the <token> and the separator. There can be whitespaces before,
7485
inside or after the <value>. The <value> may be split over multiple lines
7586
with each subsequent line starting with at least one whitespace, like
76-
the "folding" in RFC 822.
87+
the "folding" in RFC 822. Example:
88+
89+
------------------------------------------------
90+
token: This is a very long value, with spaces and
91+
newlines in it.
92+
------------------------------------------------
7793

7894
Note that trailers do not follow (nor are they intended to follow) many of the
7995
rules for RFC 822 headers. For example they do not follow the encoding rule.

0 commit comments

Comments
 (0)