Skip to content

Commit a085d39

Browse files
committed
doc: convert git-show to synopsis style
1 parent a6ec689 commit a085d39

File tree

3 files changed

+96
-65
lines changed

3 files changed

+96
-65
lines changed

Documentation/asciidoc.conf.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,18 @@ endif::backend-xhtml11[]
8181

8282
ifdef::backend-docbook[]
8383
ifdef::doctype-manpage[]
84+
[blockdef-open]
85+
synopsis-style=template="verseparagraph",filter="sed 's!&#8230;\\(\\]\\|$\\)!<phrase>\\0</phrase>!g;s!\\([\\[ |()]\\|^\\|\\]\\|&gt;\\)\\([-=a-zA-Z0-9:+@,\\/_^\\$.\\\\\\*]\\+\\|&#8230;\\)!\\1<literal>\\2</literal>!g;s!&lt;[-a-zA-Z0-9.]\\+&gt;!<emphasis>\\0</emphasis>!g'"
86+
8487
[paradef-default]
8588
synopsis-style=template="verseparagraph",filter="sed 's!&#8230;\\(\\]\\|$\\)!<phrase>\\0</phrase>!g;s!\\([\\[ |()]\\|^\\|\\]\\|&gt;\\)\\([-=a-zA-Z0-9:+@,\\/_^\\$.\\\\\\*]\\+\\|&#8230;\\)!\\1<literal>\\2</literal>!g;s!&lt;[-a-zA-Z0-9.]\\+&gt;!<emphasis>\\0</emphasis>!g'"
8689
endif::doctype-manpage[]
8790
endif::backend-docbook[]
8891

8992
ifdef::backend-xhtml11[]
93+
[blockdef-open]
94+
synopsis-style=template="verseparagraph",filter="sed 's!&#8230;\\(\\]\\|$\\)!<span>\\0</span>!g;s!\\([\\[ |()]\\|^\\|\\]\\|&gt;\\)\\([-=a-zA-Z0-9:+@,\\/_^\\$.\\\\\\*]\\+\\|&#8230;\\)!\\1<code>\\2</code>!g;s!&lt;[-a-zA-Z0-9.]\\+&gt;!<em>\\0</em>!g'"
95+
9096
[paradef-default]
9197
synopsis-style=template="verseparagraph",filter="sed 's!&#8230;\\(\\]\\|$\\)!<span>\\0</span>!g;s!\\([\\[ |()]\\|^\\|\\]\\|&gt;\\)\\([-=a-zA-Z0-9:+@,\\/_^\\$.\\\\\\*]\\+\\|&#8230;\\)!\\1<code>\\2</code>!g;s!&lt;[-a-zA-Z0-9.]\\+&gt;!<em>\\0</em>!g'"
9298
endif::backend-xhtml11[]

Documentation/git-show.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@ git-show - Show various types of objects
88

99
SYNOPSIS
1010
--------
11-
[verse]
12-
'git show' [<options>] [<object>...]
11+
[synopsis]
12+
git show [<options>] [<object>...]
1313

1414
DESCRIPTION
1515
-----------
1616
Shows one or more objects (blobs, trees, tags and commits).
1717

1818
For commits it shows the log message and textual diff. It also
1919
presents the merge commit in a special format as produced by
20-
'git diff-tree --cc'.
20+
`git diff-tree --cc`.
2121

2222
For tags, it shows the tag message and the referenced objects.
2323

24-
For trees, it shows the names (equivalent to 'git ls-tree'
25-
with --name-only).
24+
For trees, it shows the names (equivalent to `git ls-tree`
25+
with `--name-only`).
2626

2727
For plain blobs, it shows the plain contents.
2828

29-
Some options that 'git log' command understands can be used to
29+
Some options that `git log` command understands can be used to
3030
control how the changes the commit introduces are shown.
3131

3232
This manual page describes only the most frequently used options.
3333

3434

3535
OPTIONS
3636
-------
37-
<object>...::
38-
The names of objects to show (defaults to 'HEAD').
37+
`<object>...`::
38+
The names of objects to show (defaults to `HEAD`).
3939
For a more complete list of ways to spell object names, see
4040
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
4141

Documentation/pretty-formats.adoc

Lines changed: 82 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,72 @@ config option to either another format name, or a
1818
linkgit:git-config[1]). Here are the details of the
1919
built-in formats:
2020

21-
* `oneline`
22-
23-
<hash> <title-line>
21+
`oneline`::
22+
+
23+
[synopsis]
24+
--
25+
`<hash> <title-line>`
26+
--
2427
+
2528
This 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
+
7088
This format is used to refer to another commit in a commit message and
7189
is 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
7492
placeholders, 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`::
88108
Like `email`, but lines in the commit message starting with "From "
89109
(preceded by zero or more ">") are quoted with ">" so they aren't
90110
confused as starting a new commit.
91111

92-
* `raw`
93-
+
112+
`raw`::
94113
The `raw` format shows the entire commit exactly as
95114
stored in the commit object. Notably, the hashes are
96115
displayed 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,
102121
use `--no-abbrev`.
103122

104-
* `format:<format-string>`
105-
+
123+
`format:<format-string>`::
106124
The `format:<format-string>` format allows you to specify which information
107125
you want to show. It works a little bit like printf format,
108126
with 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.<<
120138
The 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,10 @@ The placeholders are:
181204
++%><|(++_<m>_++)++:: similar to ++%<(++_<n>_++)++, ++%<|(++_<m>_++)++
182205
respectively, but padding both sides
183206
(i.e. the text is centered)
184-
207+
---
185208
- Placeholders that expand to information extracted from the commit:
209+
+
210+
---
186211
+%H+:: commit hash
187212
+%h+:: abbreviated commit hash
188213
+%T+:: tree hash
@@ -311,29 +336,29 @@ linkgit:git-interpret-trailers[1]. The `trailers` string may be followed by
311336
a colon and zero or more comma-separated options. If any option is provided
312337
multiple times, the last occurrence wins.
313338
+
314-
** `key=<key>`: only show trailers with specified <key>. Matching is done
339+
* `key=<key>`: only show trailers with specified <key>. Matching is done
315340
case-insensitively and trailing colon is optional. If option is
316341
given multiple times trailer lines matching any of the keys are
317342
shown. This option automatically enables the `only` option so that
318343
non-trailer lines in the trailer block are hidden. If that is not
319344
desired it can be disabled with `only=false`. E.g.,
320345
+%(trailers:key=Reviewed-by)+ shows trailer lines with key
321346
`Reviewed-by`.
322-
** `only[=<bool>]`: select whether non-trailer lines from the trailer
347+
* `only[=<bool>]`: select whether non-trailer lines from the trailer
323348
block should be included.
324-
** `separator=<sep>`: specify the separator inserted between trailer
349+
* `separator=<sep>`: specify the separator inserted between trailer
325350
lines. Defaults to a line feed character. The string <sep> may contain
326351
the literal formatting codes described above. To use comma as
327352
separator one must use `%x2C` as it would otherwise be parsed as
328353
next option. E.g., +%(trailers:key=Ticket,separator=%x2C )+
329354
shows all trailer lines whose key is "Ticket" separated by a comma
330355
and a space.
331-
** `unfold[=<bool>]`: make it behave as if interpret-trailer's `--unfold`
356+
* `unfold[=<bool>]`: make it behave as if interpret-trailer's `--unfold`
332357
option was given. E.g.,
333358
+%(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
359+
* `keyonly[=<bool>]`: only show the key part of the trailer.
360+
* `valueonly[=<bool>]`: only show the value part of the trailer.
361+
* `key_value_separator=<sep>`: specify the separator inserted between
337362
the key and value of each trailer. Defaults to ": ". Otherwise it
338363
shares the same semantics as `separator=<sep>` above.
339364

@@ -360,9 +385,9 @@ placeholder expands to an empty string.
360385
If you add a `' '` (space) after +%+ of a placeholder, a space
361386
is inserted immediately before the expansion if and only if the
362387
placeholder expands to a non-empty string.
388+
---
363389

364-
* `tformat:`
365-
+
390+
`tformat:`::
366391
The `tformat:` format works exactly like `format:`, except that it
367392
provides "terminator" semantics instead of "separator" semantics. In
368393
other words, each commit has the message terminator character (usually a

0 commit comments

Comments
 (0)