Skip to content

Commit 9d23142

Browse files
committed
doc: convert git tag to synopsis style
- Switch the synopsis to a synopsis block which will automatically format placeholders in italics and keywords in monospace - Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. Also add the config section in the manual page and do not refer to the man page in the description of settings when this description is already in the man page. Signed-off-by: Jean-Noël Avila <[email protected]>
1 parent 3f3e5a8 commit 9d23142

File tree

2 files changed

+104
-91
lines changed

2 files changed

+104
-91
lines changed

Documentation/config/tag.adoc

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
tag.forceSignAnnotated::
1+
`tag.forceSignAnnotated`::
22
A boolean to specify whether annotated tags created should be GPG signed.
33
If `--annotate` is specified on the command line, it takes
44
precedence over this option.
55

6-
tag.sort::
7-
This variable controls the sort ordering of tags when displayed by
8-
linkgit:git-tag[1]. Without the "--sort=<value>" option provided, the
9-
value of this variable will be used as the default.
6+
`tag.sort`::
7+
ifdef::git-tag[]
8+
This variable controls the sort ordering of tags when displayed by `git-tag`.
9+
endif::git-tag[]
10+
ifndef::git-tag[]
11+
This variable controls the sort ordering of tags when displayed by
12+
linkgit:git-tag[1].
13+
endif::git-tag[]
14+
Without the `--sort=<value>` option provided, the value of this variable will
15+
be used as the default.
1016

11-
tag.gpgSign::
17+
`tag.gpgSign`::
1218
A boolean to specify whether all tags should be GPG signed.
1319
Use of this option when running in an automated script can
1420
result in a large number of tags being signed. It is therefore
15-
convenient to use an agent to avoid typing your gpg passphrase
21+
convenient to use an agent to avoid typing your GPG passphrase
1622
several times. Note that this option doesn't affect tag signing
17-
behavior enabled by "-u <keyid>" or "--local-user=<keyid>" options.
23+
behavior enabled by `-u <keyid>` or `--local-user=<keyid>` options.

Documentation/git-tag.adoc

Lines changed: 90 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ git-tag - Create, list, delete or verify a tag object signed with GPG
88

99
SYNOPSIS
1010
--------
11-
[verse]
12-
'git tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]
11+
[synopsis]
12+
git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]
1313
[(--trailer <token>[(=|:)<value>])...]
1414
<tagname> [<commit> | <object>]
15-
'git tag' -d <tagname>...
16-
'git tag' [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]
15+
git tag -d <tagname>...
16+
git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]
1717
[--points-at <object>] [--column[=<options>] | --no-column]
1818
[--create-reflog] [--sort=<key>] [--format=<format>]
1919
[--merged <commit>] [--no-merged <commit>] [<pattern>...]
20-
'git tag' -v [--format=<format>] <tagname>...
20+
git tag -v [--format=<format>] <tagname>...
2121

2222
DESCRIPTION
2323
-----------
2424

25-
Add a tag reference in `refs/tags/`, unless `-d/-l/-v` is given
25+
Add a tag reference in `refs/tags/`, unless `-d`/`-l`/`-v` is given
2626
to delete, list or verify tags.
2727

2828
Unless `-f` is given, the named tag must not yet exist.
@@ -58,129 +58,129 @@ lightweight tags by default.
5858

5959
OPTIONS
6060
-------
61-
-a::
62-
--annotate::
61+
`-a`::
62+
`--annotate`::
6363
Make an unsigned, annotated tag object
6464

65-
-s::
66-
--sign::
65+
`-s`::
66+
`--sign`::
6767
Make a GPG-signed tag, using the default e-mail address's key.
6868
The default behavior of tag GPG-signing is controlled by `tag.gpgSign`
6969
configuration variable if it exists, or disabled otherwise.
7070
See linkgit:git-config[1].
7171

72-
--no-sign::
72+
`--no-sign`::
7373
Override `tag.gpgSign` configuration variable that is
7474
set to force each and every tag to be signed.
7575

76-
-u <key-id>::
77-
--local-user=<key-id>::
76+
`-u <key-id>`::
77+
`--local-user=<key-id>`::
7878
Make a GPG-signed tag, using the given key.
7979

80-
-f::
81-
--force::
80+
`-f`::
81+
`--force`::
8282
Replace an existing tag with the given name (instead of failing)
8383

84-
-d::
85-
--delete::
84+
`-d`::
85+
`--delete`::
8686
Delete existing tags with the given names.
8787

88-
-v::
89-
--verify::
88+
`-v`::
89+
`--verify`::
9090
Verify the GPG signature of the given tag names.
9191

92-
-n<num>::
93-
<num> specifies how many lines from the annotation, if any,
94-
are printed when using -l. Implies `--list`.
92+
`-n<num>`::
93+
_<num>_ specifies how many lines from the annotation, if any,
94+
are printed when using `-l`. Implies `--list`.
9595
+
9696
The default is not to print any annotation lines.
9797
If no number is given to `-n`, only the first line is printed.
9898
If the tag is not annotated, the commit message is displayed instead.
9999

100-
-l::
101-
--list::
100+
`-l`::
101+
`--list`::
102102
List tags. With optional `<pattern>...`, e.g. `git tag --list
103103
'v-*'`, list only the tags that match the pattern(s).
104104
+
105-
Running "git tag" without arguments also lists all tags. The pattern
106-
is a shell wildcard (i.e., matched using fnmatch(3)). Multiple
105+
Running `git tag` without arguments also lists all tags. The pattern
106+
is a shell wildcard (i.e., matched using `fnmatch`(3)). Multiple
107107
patterns may be given; if any of them matches, the tag is shown.
108108
+
109109
This option is implicitly supplied if any other list-like option such
110110
as `--contains` is provided. See the documentation for each of those
111111
options for details.
112112

113-
--sort=<key>::
113+
`--sort=<key>`::
114114
Sort based on the key given. Prefix `-` to sort in
115-
descending order of the value. You may use the --sort=<key> option
116-
multiple times, in which case the last key becomes the primary
117-
key. Also supports "version:refname" or "v:refname" (tag
118-
names are treated as versions). The "version:refname" sort
119-
order can also be affected by the "versionsort.suffix"
115+
descending order of the value. You may use the `--sort=<key>` option
116+
multiple times, in which case the last _<key>_ becomes the primary
117+
key. Also supports "`version:refname`" or "`v:refname`" (tag
118+
names are treated as versions). The "`version:refname`" sort
119+
order can also be affected by the "`versionsort.suffix`"
120120
configuration variable.
121121
The keys supported are the same as those in `git for-each-ref`.
122122
Sort order defaults to the value configured for the `tag.sort`
123123
variable if it exists, or lexicographic order otherwise. See
124124
linkgit:git-config[1].
125125

126-
--color[=<when>]::
126+
`--color[=<when>]`::
127127
Respect any colors specified in the `--format` option. The
128-
`<when>` field must be one of `always`, `never`, or `auto` (if
129-
`<when>` is absent, behave as if `always` was given).
128+
_<when>_ field must be one of `always`, `never`, or `auto` (if
129+
_<when>_ is absent, behave as if `always` was given).
130130

131-
-i::
132-
--ignore-case::
131+
`-i`::
132+
`--ignore-case`::
133133
Sorting and filtering tags are case insensitive.
134134

135-
--omit-empty::
135+
`--omit-empty`::
136136
Do not print a newline after formatted refs where the format expands
137137
to the empty string.
138138

139-
--column[=<options>]::
140-
--no-column::
139+
`--column[=<options>]`::
140+
`--no-column`::
141141
Display tag listing in columns. See configuration variable
142142
`column.tag` for option syntax. `--column` and `--no-column`
143-
without options are equivalent to 'always' and 'never' respectively.
143+
without options are equivalent to `always` and `never` respectively.
144144
+
145145
This option is only applicable when listing tags without annotation lines.
146146

147-
--contains [<commit>]::
148-
Only list tags which contain the specified commit (HEAD if not
147+
`--contains [<commit>]`::
148+
Only list tags which contain _<commit>_ (`HEAD` if not
149149
specified). Implies `--list`.
150150

151-
--no-contains [<commit>]::
152-
Only list tags which don't contain the specified commit (HEAD if
151+
`--no-contains [<commit>]`::
152+
Only list tags which don't contain _<commit>_ (`HEAD` if
153153
not specified). Implies `--list`.
154154

155-
--merged [<commit>]::
156-
Only list tags whose commits are reachable from the specified
157-
commit (`HEAD` if not specified).
155+
`--merged [<commit>]`::
156+
Only list tags whose commits are reachable from
157+
_<commit>_ (`HEAD` if not specified).
158158

159-
--no-merged [<commit>]::
160-
Only list tags whose commits are not reachable from the specified
161-
commit (`HEAD` if not specified).
159+
`--no-merged [<commit>]`::
160+
Only list tags whose commits are not reachable from
161+
_<commit>_ (`HEAD` if not specified).
162162

163-
--points-at <object>::
164-
Only list tags of the given object (HEAD if not
163+
`--points-at [<object>]`::
164+
Only list tags of _<object>_ (`HEAD` if not
165165
specified). Implies `--list`.
166166

167-
-m <msg>::
168-
--message=<msg>::
169-
Use the given tag message (instead of prompting).
167+
`-m <msg>`::
168+
`--message=<msg>`::
169+
Use _<msg>_ (instead of prompting).
170170
If multiple `-m` options are given, their values are
171171
concatenated as separate paragraphs.
172172
Implies `-a` if none of `-a`, `-s`, or `-u <key-id>`
173173
is given.
174174

175-
-F <file>::
176-
--file=<file>::
177-
Take the tag message from the given file. Use '-' to
175+
`-F <file>`::
176+
`--file=<file>`::
177+
Take the tag message from _<file>_. Use `-` to
178178
read the message from the standard input.
179179
Implies `-a` if none of `-a`, `-s`, or `-u <key-id>`
180180
is given.
181181

182-
--trailer <token>[(=|:)<value>]::
183-
Specify a (<token>, <value>) pair that should be applied as a
182+
`--trailer <token>[(=|:)<value>]`::
183+
Specify a (_<token>_, _<value>_) pair that should be applied as a
184184
trailer. (e.g. `git tag --trailer "Custom-Key: value"`
185185
will add a "Custom-Key" trailer to the tag message.)
186186
The `trailer.*` configuration variables
@@ -190,46 +190,45 @@ This option is only applicable when listing tags without annotation lines.
190190
The trailers can be extracted in `git tag --list`, using
191191
`--format="%(trailers)"` placeholder.
192192

193-
-e::
194-
--edit::
195-
The message taken from file with `-F` and command line with
196-
`-m` are usually used as the tag message unmodified.
197-
This option lets you further edit the message taken from these sources.
193+
`-e`::
194+
`--edit`::
195+
Let further edit the message taken from file with `-F` and command line with
196+
`-m`.
198197

199-
--cleanup=<mode>::
200-
This option sets how the tag message is cleaned up.
201-
The '<mode>' can be one of 'verbatim', 'whitespace' and 'strip'. The
202-
'strip' mode is default. The 'verbatim' mode does not change message at
203-
all, 'whitespace' removes just leading/trailing whitespace lines and
204-
'strip' removes both whitespace and commentary.
198+
`--cleanup=<mode>`::
199+
Set how the tag message is cleaned up.
200+
The _<mode>_ can be one of `verbatim`, `whitespace` and `strip`. The
201+
`strip` mode is default. The `verbatim` mode does not change message at
202+
all, `whitespace` removes just leading/trailing whitespace lines and
203+
`strip` removes both whitespace and commentary.
205204

206-
--create-reflog::
205+
`--create-reflog`::
207206
Create a reflog for the tag. To globally enable reflogs for tags, see
208207
`core.logAllRefUpdates` in linkgit:git-config[1].
209208
The negated form `--no-create-reflog` only overrides an earlier
210209
`--create-reflog`, but currently does not negate the setting of
211210
`core.logAllRefUpdates`.
212211

213-
--format=<format>::
212+
`--format=<format>`::
214213
A string that interpolates `%(fieldname)` from a tag ref being shown
215214
and the object it points at. The format is the same as
216215
that of linkgit:git-for-each-ref[1]. When unspecified,
217216
defaults to `%(refname:strip=2)`.
218217

219-
<tagname>::
218+
_<tagname>_::
220219
The name of the tag to create, delete, or describe.
221220
The new tag name must pass all checks defined by
222221
linkgit:git-check-ref-format[1]. Some of these checks
223222
may restrict the characters allowed in a tag name.
224223

225-
<commit>::
226-
<object>::
224+
_<commit>_::
225+
_<object>_::
227226
The object that the new tag will refer to, usually a commit.
228-
Defaults to HEAD.
227+
Defaults to `HEAD`.
229228

230229
CONFIGURATION
231230
-------------
232-
By default, 'git tag' in sign-with-default mode (-s) will use your
231+
By default, `git tag` in sign-with-default mode (`-s`) will use your
233232
committer identity (of the form `Your Name <[email protected]>`) to
234233
find a key. If you want to use a different default key, you can specify
235234
it in the repository configuration as follows:
@@ -252,7 +251,7 @@ On Re-tagging
252251
What should you do when you tag a wrong commit and you would
253252
want to re-tag?
254253

255-
If you never pushed anything out, just re-tag it. Use "-f" to
254+
If you never pushed anything out, just re-tag it. Use `-f` to
256255
replace the old one. And you're done.
257256

258257
But if you have pushed things out (or others could just read
@@ -268,12 +267,12 @@ the old tag. In that case you can do one of two things:
268267
269268
. The insane thing.
270269
You really want to call the new version "X" too, 'even though'
271-
others have already seen the old one. So just use 'git tag -f'
270+
others have already seen the old one. So just use `git tag -f`
272271
again, as if you hadn't already published the old one.
273272

274273
However, Git does *not* (and it should not) change tags behind
275274
users back. So if somebody already got the old tag, doing a
276-
'git pull' on your tree shouldn't just make them overwrite the old
275+
`git pull` on your tree shouldn't just make them overwrite the old
277276
one.
278277

279278
If somebody got a release tag from you, you cannot just change
@@ -325,7 +324,7 @@ private anchor point tags from the other person.
325324

326325
Often, "please pull" messages on the mailing list just provide
327326
two pieces of information: a repo URL and a branch name; this
328-
is designed to be easily cut&pasted at the end of a 'git fetch'
327+
is designed to be easily cut&pasted at the end of a `git fetch`
329328
command line:
330329

331330
------------
@@ -403,6 +402,14 @@ FILES
403402
user in an editor session will be available in this file, but
404403
may be overwritten by the next invocation of `git tag`.
405404

405+
CONFIGURATION
406+
-------------
407+
408+
include::includes/cmd-config-section-all.adoc[]
409+
410+
:git-tag: 1
411+
include::config/tag.adoc[]
412+
406413
NOTES
407414
-----
408415

0 commit comments

Comments
 (0)