Skip to content

Commit af5c1aa

Browse files
committed
doc: convert git-show to synopsis style
* add synopsis block definition in asciidoc.conf.in * convert commands to synopsis style * use _<placeholder>_ for arguments * minor formatting fixes Signed-off-by: Jean-Noël Avila <[email protected]>
1 parent fb5e5c7 commit af5c1aa

File tree

3 files changed

+108
-78
lines changed

3 files changed

+108
-78
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: 94 additions & 70 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,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
233259
literal formatting codes. These must be used for commas (`%x2C`) and closing
234260
parentheses (`%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-
--
245270
For example, to produce decorations with no wrapping
246271
or tag annotations, and spaces as separators:
247-
272+
+
248273
++%(decorate:prefix=,suffix=,tag=,separator= )++
249-
--
250274

251-
++%(describe++`[:<option>,...]`++)++::
275+
++%(`describe++``[:<option>,...]`++)++::
252276
human-readable name, like linkgit:git-describe[1]; empty string for
253277
undescribable commits. The `describe` string may be followed by a colon and
254278
zero or more comma-separated options. Descriptions can be inconsistent when
255279
tags 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
311335
a colon and zero or more comma-separated options. If any option is provided
312336
multiple 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.
360384
If you add a `' '` (space) after +%+ of a placeholder, a space
361385
is inserted immediately before the expansion if and only if the
362386
placeholder expands to a non-empty string.
387+
--
363388

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

0 commit comments

Comments
 (0)