@@ -18,54 +18,72 @@ config option to either another format name, or a
1818linkgit:git-config[1]). Here are the details of the
1919built-in formats:
2020
21- * `oneline`
22-
23- <hash> <title-line>
21+ `oneline` ::
22+ +
23+ [synopsis]
24+ --
25+ `<hash> <title-line>`
26+ --
2427+
2528This is designed to be as compact as possible.
2629
27- * `short`
28-
29- commit <hash>
30- Author: <author>
31-
32- <title-line>
33-
34- * `medium`
35-
36- commit <hash>
37- Author: <author>
38- Date: <author-date>
39-
40- <title-line>
30+ `short` ::
31+ +
32+ [synopsis]
33+ --
34+ commit <hash >
35+ Author: <author >
4136
42- <full-commit-message>
37+ <title-line>
38+ --
4339
44- * `full`
40+ `medium`::
41+ +
42+ [synopsis]
43+ --
44+ commit <hash>
45+ Author: <author>
46+ Date: <author-date>
4547
46- commit <hash>
47- Author: <author>
48- Commit: <committer>
48+ <title-line>
4949
50- <title-line>
50+ <full-commit-message>
51+ --
5152
52- <full-commit-message>
53+ `full`::
54+ +
55+ [synopsis]
56+ --
57+ commit <hash>
58+ Author: <author>
59+ Commit: <committer>
5360
54- * `fuller`
61+ <title-line>
5562
56- commit <hash>
57- Author: <author>
58- AuthorDate: <author-date>
59- Commit: <committer>
60- CommitDate: <committer-date>
63+ <full-commit-message>
64+ --
6165
62- <title-line>
66+ `fuller`::
67+ +
68+ [synopsis]
69+ --
70+ commit <hash>
71+ Author: <author>
72+ AuthorDate: <author-date>
73+ Commit: <committer>
74+ CommitDate: <committer-date>
6375
64- <full-commit-message >
76+ <title-line >
6577
66- * `reference`
78+ <full-commit-message>
79+ --
6780
68- <abbrev-hash> (<title-line>, <short-author-date>)
81+ `reference`::
82+ +
83+ [synopsis]
84+ --
85+ <abbrev-hash> (<title-line>, <short-author-date>)
86+ --
6987+
7088This format is used to refer to another commit in a commit message and
7189is the same as ++--pretty=\'format:%C(auto)%h (%s, %ad)'++. By default,
@@ -74,23 +92,24 @@ is explicitly specified. As with any `format:` with format
7492placeholders, its output is not affected by other options like
7593`--decorate` and `--walk-reflogs`.
7694
77- * `email`
78-
79- From <hash> <date>
80- From: <author>
81- Date: <author-date>
82- Subject: [PATCH] <title-line>
95+ `email`::
96+ +
97+ [synopsis]
98+ --
99+ From <hash> <date>
100+ From: <author>
101+ Date: <author-date>
102+ Subject: [PATCH] <title-line>
83103
84- <full-commit-message>
104+ <full-commit-message>
105+ --
85106
86- * `mboxrd`
87- +
107+ `mboxrd`::
88108Like `email`, but lines in the commit message starting with "From "
89109(preceded by zero or more ">") are quoted with ">" so they aren't
90110confused as starting a new commit.
91111
92- * `raw`
93- +
112+ `raw`::
94113The `raw` format shows the entire commit exactly as
95114stored in the commit object. Notably, the hashes are
96115displayed in full, regardless of whether `--abbrev` or
@@ -101,8 +120,7 @@ commits are displayed, but not the way the diff is shown e.g. with
101120`git log --raw`. To get full object names in a raw diff format,
102121use `--no-abbrev`.
103122
104- * `format:<format-string>`
105- +
123+ `format:<format-string>`::
106124The `format:<format-string>` format allows you to specify which information
107125you want to show. It works a little bit like printf format,
108126with the notable exception that you get a newline with `%n`
@@ -120,13 +138,18 @@ The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<
120138The placeholders are:
121139
122140- Placeholders that expand to a single literal character:
141+ +
142+ --
123143++%n++:: newline
124144++%%++:: a raw ++%++
125145++%x00++:: ++%x++ followed by two hexadecimal digits is replaced with a
126146 byte with the hexadecimal digits' value (we will call this
127147 "literal formatting code" in the rest of this document).
148+ --
128149
129150- Placeholders that affect formatting of later placeholders:
151+ +
152+ --
130153++%Cred++:: switch color to red
131154++%Cgreen++:: switch color to green
132155++%Cblue++:: switch color to blue
@@ -181,8 +204,11 @@ The placeholders are:
181204++%><|(++_<m>_++)++:: similar to ++%<(++_<n>_++)++, ++%<|(++_<m>_++)++
182205 respectively, but padding both sides
183206 (i.e. the text is centered)
207+ --
184208
185209- Placeholders that expand to information extracted from the commit:
210+ +
211+ --
186212+%H+:: commit hash
187213+%h+:: abbreviated commit hash
188214+%T+:: tree hash
@@ -233,36 +259,34 @@ colon and zero or more comma-separated options. Option values may contain
233259literal formatting codes. These must be used for commas (`%x2C`) and closing
234260parentheses (`%x29`), due to their role in the option syntax.
235261
236- ** `prefix=<value>`: Shown before the list of ref names. Defaults to "{nbsp}++(++".
237- ** `suffix=<value>`: Shown after the list of ref names. Defaults to "+)+".
238- ** `separator=<value>`: Shown between ref names. Defaults to "+,+{nbsp}".
239- ** `pointer=<value>`: Shown between HEAD and the branch it points to, if any.
240- Defaults to "{nbsp}++->++{nbsp}".
241- ** `tag=<value>`: Shown before tag names. Defaults to "`tag:`{nbsp}".
262+ `prefix=<value>`;; Shown before the list of ref names. Defaults to "{nbsp}++(++".
263+ `suffix=<value>`;; Shown after the list of ref names. Defaults to "+)+".
264+ `separator=<value>`;; Shown between ref names. Defaults to "+,+{nbsp}".
265+ `pointer=<value>`;; Shown between HEAD and the branch it points to, if any.
266+ Defaults to "{nbsp}++->++{nbsp}".
267+ `tag=<value>`;; Shown before tag names. Defaults to "`tag:`{nbsp}".
242268
243269+
244- --
245270For example, to produce decorations with no wrapping
246271or tag annotations, and spaces as separators:
247-
272+ +
248273++%(decorate:prefix=,suffix=,tag=,separator= )++
249- --
250274
251- ++%(describe++`[:<option>,...]`++)++::
275+ ++%(` describe++` `[:<option>,...]`++)++::
252276human-readable name, like linkgit:git-describe[1]; empty string for
253277undescribable commits. The `describe` string may be followed by a colon and
254278zero or more comma-separated options. Descriptions can be inconsistent when
255279tags are added or removed at the same time.
256280+
257- ** `tags[=<bool-value>]`: Instead of only considering annotated tags,
281+ `tags[=<bool-value>]`;; Instead of only considering annotated tags,
258282 consider lightweight tags as well.
259- ** `abbrev=<number>`: Instead of using the default number of hexadecimal digits
283+ `abbrev=<number>`;; Instead of using the default number of hexadecimal digits
260284 (which will vary according to the number of objects in the repository with a
261285 default of 7) of the abbreviated object name, use <number> digits, or as many
262286 digits as needed to form a unique object name.
263- ** `match=<pattern>`: Only consider tags matching the given
287+ `match=<pattern>`;; Only consider tags matching the given
264288 `glob(7)` _<pattern>_, excluding the `refs/tags/` prefix.
265- ** `exclude=<pattern>`: Do not consider tags matching the given
289+ `exclude=<pattern>`;; Do not consider tags matching the given
266290 `glob(7)` _<pattern>_, excluding the `refs/tags/` prefix.
267291
268292+%S+:: ref name given on the command line by which the commit was reached
@@ -311,29 +335,29 @@ linkgit:git-interpret-trailers[1]. The `trailers` string may be followed by
311335a colon and zero or more comma-separated options. If any option is provided
312336multiple times, the last occurrence wins.
313337+
314- ** `key=<key>`: only show trailers with specified <key>. Matching is done
338+ `key=<key>`;; only show trailers with specified <key>. Matching is done
315339 case-insensitively and trailing colon is optional. If option is
316340 given multiple times trailer lines matching any of the keys are
317341 shown. This option automatically enables the `only` option so that
318342 non-trailer lines in the trailer block are hidden. If that is not
319343 desired it can be disabled with `only=false`. E.g.,
320344 +%(trailers:key=Reviewed-by)+ shows trailer lines with key
321345 `Reviewed-by`.
322- ** `only[=<bool>]`: select whether non-trailer lines from the trailer
346+ `only[=<bool>]`;; select whether non-trailer lines from the trailer
323347 block should be included.
324- ** `separator=<sep>`: specify the separator inserted between trailer
348+ `separator=<sep>`;; specify the separator inserted between trailer
325349 lines. Defaults to a line feed character. The string <sep> may contain
326350 the literal formatting codes described above. To use comma as
327351 separator one must use `%x2C` as it would otherwise be parsed as
328352 next option. E.g., +%(trailers:key=Ticket,separator=%x2C )+
329353 shows all trailer lines whose key is "Ticket" separated by a comma
330354 and a space.
331- ** `unfold[=<bool>]`: make it behave as if interpret-trailer's `--unfold`
355+ `unfold[=<bool>]`;; make it behave as if interpret-trailer's `--unfold`
332356 option was given. E.g.,
333357 +%(trailers:only,unfold=true)+ unfolds and shows all trailer lines.
334- ** `keyonly[=<bool>]`: only show the key part of the trailer.
335- ** `valueonly[=<bool>]`: only show the value part of the trailer.
336- ** `key_value_separator=<sep>`: specify the separator inserted between
358+ `keyonly[=<bool>]`;; only show the key part of the trailer.
359+ `valueonly[=<bool>]`;; only show the value part of the trailer.
360+ `key_value_separator=<sep>`;; specify the separator inserted between
337361 the key and value of each trailer. Defaults to ": ". Otherwise it
338362 shares the same semantics as `separator=<sep>` above.
339363
@@ -360,9 +384,9 @@ placeholder expands to an empty string.
360384If you add a `' '` (space) after +%+ of a placeholder, a space
361385is inserted immediately before the expansion if and only if the
362386placeholder expands to a non-empty string.
387+ --
363388
364- * `tformat:`
365- +
389+ `tformat:`::
366390The `tformat:` format works exactly like `format:`, except that it
367391provides "terminator" semantics instead of "separator" semantics. In
368392other words, each commit has the message terminator character (usually a
0 commit comments