Git fork

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 <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Jean-Noël Avila and committed by
Junio C Hamano
0fc3a21a a92d0607

+104 -91
+14 -8
Documentation/config/tag.adoc
··· 1 - tag.forceSignAnnotated:: 1 + `tag.forceSignAnnotated`:: 2 2 A boolean to specify whether annotated tags created should be GPG signed. 3 3 If `--annotate` is specified on the command line, it takes 4 4 precedence over this option. 5 5 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. 10 16 11 - tag.gpgSign:: 17 + `tag.gpgSign`:: 12 18 A boolean to specify whether all tags should be GPG signed. 13 19 Use of this option when running in an automated script can 14 20 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 16 22 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.
+90 -83
Documentation/git-tag.adoc
··· 8 8 9 9 SYNOPSIS 10 10 -------- 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] 13 13 [(--trailer <token>[(=|:)<value>])...] 14 14 <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>] 17 17 [--points-at <object>] [--column[=<options>] | --no-column] 18 18 [--create-reflog] [--sort=<key>] [--format=<format>] 19 19 [--merged <commit>] [--no-merged <commit>] [<pattern>...] 20 - 'git tag' -v [--format=<format>] <tagname>... 20 + git tag -v [--format=<format>] <tagname>... 21 21 22 22 DESCRIPTION 23 23 ----------- 24 24 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 26 26 to delete, list or verify tags. 27 27 28 28 Unless `-f` is given, the named tag must not yet exist. ··· 58 58 59 59 OPTIONS 60 60 ------- 61 - -a:: 62 - --annotate:: 61 + `-a`:: 62 + `--annotate`:: 63 63 Make an unsigned, annotated tag object 64 64 65 - -s:: 66 - --sign:: 65 + `-s`:: 66 + `--sign`:: 67 67 Make a GPG-signed tag, using the default e-mail address's key. 68 68 The default behavior of tag GPG-signing is controlled by `tag.gpgSign` 69 69 configuration variable if it exists, or disabled otherwise. 70 70 See linkgit:git-config[1]. 71 71 72 - --no-sign:: 72 + `--no-sign`:: 73 73 Override `tag.gpgSign` configuration variable that is 74 74 set to force each and every tag to be signed. 75 75 76 - -u <key-id>:: 77 - --local-user=<key-id>:: 76 + `-u <key-id>`:: 77 + `--local-user=<key-id>`:: 78 78 Make a GPG-signed tag, using the given key. 79 79 80 - -f:: 81 - --force:: 80 + `-f`:: 81 + `--force`:: 82 82 Replace an existing tag with the given name (instead of failing) 83 83 84 - -d:: 85 - --delete:: 84 + `-d`:: 85 + `--delete`:: 86 86 Delete existing tags with the given names. 87 87 88 - -v:: 89 - --verify:: 88 + `-v`:: 89 + `--verify`:: 90 90 Verify the GPG signature of the given tag names. 91 91 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`. 95 95 + 96 96 The default is not to print any annotation lines. 97 97 If no number is given to `-n`, only the first line is printed. 98 98 If the tag is not annotated, the commit message is displayed instead. 99 99 100 - -l:: 101 - --list:: 100 + `-l`:: 101 + `--list`:: 102 102 List tags. With optional `<pattern>...`, e.g. `git tag --list 103 103 'v-*'`, list only the tags that match the pattern(s). 104 104 + 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 107 107 patterns may be given; if any of them matches, the tag is shown. 108 108 + 109 109 This option is implicitly supplied if any other list-like option such 110 110 as `--contains` is provided. See the documentation for each of those 111 111 options for details. 112 112 113 - --sort=<key>:: 113 + `--sort=<key>`:: 114 114 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`" 120 120 configuration variable. 121 121 The keys supported are the same as those in `git for-each-ref`. 122 122 Sort order defaults to the value configured for the `tag.sort` 123 123 variable if it exists, or lexicographic order otherwise. See 124 124 linkgit:git-config[1]. 125 125 126 - --color[=<when>]:: 126 + `--color[=<when>]`:: 127 127 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). 130 130 131 - -i:: 132 - --ignore-case:: 131 + `-i`:: 132 + `--ignore-case`:: 133 133 Sorting and filtering tags are case insensitive. 134 134 135 - --omit-empty:: 135 + `--omit-empty`:: 136 136 Do not print a newline after formatted refs where the format expands 137 137 to the empty string. 138 138 139 - --column[=<options>]:: 140 - --no-column:: 139 + `--column[=<options>]`:: 140 + `--no-column`:: 141 141 Display tag listing in columns. See configuration variable 142 142 `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. 144 144 + 145 145 This option is only applicable when listing tags without annotation lines. 146 146 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 149 149 specified). Implies `--list`. 150 150 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 153 153 not specified). Implies `--list`. 154 154 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). 158 158 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). 162 162 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 165 165 specified). Implies `--list`. 166 166 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). 170 170 If multiple `-m` options are given, their values are 171 171 concatenated as separate paragraphs. 172 172 Implies `-a` if none of `-a`, `-s`, or `-u <key-id>` 173 173 is given. 174 174 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 178 178 read the message from the standard input. 179 179 Implies `-a` if none of `-a`, `-s`, or `-u <key-id>` 180 180 is given. 181 181 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 184 184 trailer. (e.g. `git tag --trailer "Custom-Key: value"` 185 185 will add a "Custom-Key" trailer to the tag message.) 186 186 The `trailer.*` configuration variables ··· 190 190 The trailers can be extracted in `git tag --list`, using 191 191 `--format="%(trailers)"` placeholder. 192 192 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`. 198 197 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. 205 204 206 - --create-reflog:: 205 + `--create-reflog`:: 207 206 Create a reflog for the tag. To globally enable reflogs for tags, see 208 207 `core.logAllRefUpdates` in linkgit:git-config[1]. 209 208 The negated form `--no-create-reflog` only overrides an earlier 210 209 `--create-reflog`, but currently does not negate the setting of 211 210 `core.logAllRefUpdates`. 212 211 213 - --format=<format>:: 212 + `--format=<format>`:: 214 213 A string that interpolates `%(fieldname)` from a tag ref being shown 215 214 and the object it points at. The format is the same as 216 215 that of linkgit:git-for-each-ref[1]. When unspecified, 217 216 defaults to `%(refname:strip=2)`. 218 217 219 - <tagname>:: 218 + _<tagname>_:: 220 219 The name of the tag to create, delete, or describe. 221 220 The new tag name must pass all checks defined by 222 221 linkgit:git-check-ref-format[1]. Some of these checks 223 222 may restrict the characters allowed in a tag name. 224 223 225 - <commit>:: 226 - <object>:: 224 + _<commit>_:: 225 + _<object>_:: 227 226 The object that the new tag will refer to, usually a commit. 228 - Defaults to HEAD. 227 + Defaults to `HEAD`. 229 228 230 229 CONFIGURATION 231 230 ------------- 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 233 232 committer identity (of the form `Your Name <your@email.address>`) to 234 233 find a key. If you want to use a different default key, you can specify 235 234 it in the repository configuration as follows: ··· 252 251 What should you do when you tag a wrong commit and you would 253 252 want to re-tag? 254 253 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 256 255 replace the old one. And you're done. 257 256 258 257 But if you have pushed things out (or others could just read ··· 268 267 269 268 . The insane thing. 270 269 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` 272 271 again, as if you hadn't already published the old one. 273 272 274 273 However, Git does *not* (and it should not) change tags behind 275 274 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 277 276 one. 278 277 279 278 If somebody got a release tag from you, you cannot just change ··· 325 324 326 325 Often, "please pull" messages on the mailing list just provide 327 326 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` 329 328 command line: 330 329 331 330 ------------ ··· 402 401 annotated tag then the tag message that has been provided by the 403 402 user in an editor session will be available in this file, but 404 403 may be overwritten by the next invocation of `git tag`. 404 + 405 + CONFIGURATION 406 + ------------- 407 + 408 + include::includes/cmd-config-section-all.adoc[] 409 + 410 + :git-tag: 1 411 + include::config/tag.adoc[] 405 412 406 413 NOTES 407 414 -----