Skip to content

Commit 7798d18

Browse files
chriscoolgitster
authored andcommitted
doc: git-tag: stop focussing on GPG signed tags
It looks like the documentation of `git tag` is focussed a bit too much on GPG signed tags. This starts with the "NAME" section where the command is described with: "Create, list, delete or verify a tag object signed with GPG" while for example `git branch` is described with simply: "List, create, or delete branches" This could give the false impression that `git tag` only works with tag objects, not with lightweight tags, and that tag objects are always GPG signed. In the "DESCRIPTION" section, it looks like only "GnuPG signed tag objects" can be created by the `-s` and `-u <key-id>` options, and it seems `gpg.program` can only specify a "custom GnuPG binary". This goes on in the "OPTIONS" section too, especially about the `-s` and `-u <key-id>` options. The "CONFIGURATION" also doesn't talk about how to configure the command to work with X.509 and SSH signatures. Let's rework all that to make sure users have a more accurate and balanced view of what the command can do. Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 15eff6b commit 7798d18

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

Documentation/git-tag.adoc

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ git-tag(1)
33

44
NAME
55
----
6-
git-tag - Create, list, delete or verify a tag object signed with GPG
6+
git-tag - Create, list, delete or verify tags
77

88

99
SYNOPSIS
@@ -38,17 +38,18 @@ and `-a`, `-s`, and `-u <key-id>` are absent, `-a` is implied.
3838
Otherwise, a tag reference that points directly at the given object
3939
(i.e., a lightweight tag) is created.
4040

41-
A GnuPG signed tag object will be created when `-s` or `-u
42-
<key-id>` is used. When `-u <key-id>` is not used, the
43-
committer identity for the current user is used to find the
44-
GnuPG key for signing. The configuration variable `gpg.program`
45-
is used to specify custom GnuPG binary.
41+
A cryptographically signed tag object will be created when `-s` or
42+
`-u <key-id>` is used. The signing backend (GPG, X.509, SSH, etc.) is
43+
controlled by the `gpg.format` configuration variable, defaulting to
44+
OpenPGP. When `-u <key-id>` is not used, the committer identity for
45+
the current user is used to find the key for signing. The
46+
configuration variable `gpg.program` is used to specify a custom
47+
signing binary.
4648

4749
Tag objects (created with `-a`, `-s`, or `-u`) are called "annotated"
4850
tags; they contain a creation date, the tagger name and e-mail, a
49-
tagging message, and an optional GnuPG signature. Whereas a
50-
"lightweight" tag is simply a name for an object (usually a commit
51-
object).
51+
tagging message, and an optional signature. Whereas a "lightweight"
52+
tag is simply a name for an object (usually a commit object).
5253

5354
Annotated tags are meant for release while lightweight tags are meant
5455
for private or temporary object labels. For this reason, some git
@@ -64,18 +65,22 @@ OPTIONS
6465

6566
-s::
6667
--sign::
67-
Make a GPG-signed tag, using the default e-mail address's key.
68-
The default behavior of tag GPG-signing is controlled by `tag.gpgSign`
69-
configuration variable if it exists, or disabled otherwise.
70-
See linkgit:git-config[1].
68+
Make a signed tag, using the default signing key. The signing
69+
backend used depends on the `gpg.format` configuration
70+
variable. The default key is determined by the backend. For
71+
GPG, it's based on the committer's email address, while for
72+
SSH it may be a specific key file or agent identity. See
73+
linkgit:git-config[1].
7174

7275
--no-sign::
7376
Override `tag.gpgSign` configuration variable that is
7477
set to force each and every tag to be signed.
7578

7679
-u <key-id>::
7780
--local-user=<key-id>::
78-
Make a GPG-signed tag, using the given key.
81+
Make a signed tag using the given key. The format of the
82+
<key-id> and the backend used depend on the `gpg.format`
83+
configuration variable. See linkgit:git-config[1].
7984

8085
-f::
8186
--force::
@@ -87,7 +92,7 @@ OPTIONS
8792

8893
-v::
8994
--verify::
90-
Verify the GPG signature of the given tag names.
95+
Verify the signature of the given tag names.
9196

9297
-n<num>::
9398
<num> specifies how many lines from the annotation, if any,
@@ -236,12 +241,25 @@ it in the repository configuration as follows:
236241

237242
-------------------------------------
238243
[user]
239-
signingKey = <gpg-key-id>
244+
signingKey = <key-id>
240245
-------------------------------------
241246

247+
The signing backend is controlled by the `gpg.format` configuration
248+
variable, which defaults to `openpgp` for GPG signing. To sign tags
249+
using other technologies like X.509 or SSH, set this variable to
250+
`x509` or `ssh` respectively.
251+
252+
You can also specify the path to the signing program for each
253+
format. The `gpg.program` variable (or its synonym
254+
`gpg.openpgp.program`) is used for the OpenPGP backend. For other
255+
backends, the configuration is `gpg.<format>.program`, for example
256+
`gpg.ssh.program` for SSH signing.
257+
242258
`pager.tag` is only respected when listing tags, i.e., when `-l` is
243259
used or implied. The default is to use a pager.
244-
See linkgit:git-config[1].
260+
261+
See linkgit:git-config[1] for more details and other configuration
262+
variables.
245263

246264
DISCUSSION
247265
----------

0 commit comments

Comments
 (0)