git-tag: add flag to verify a tag
This way "git tag -v $tag" is the UI for git-verify-tag. Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Santi Béjar committed
Jan 3, 2007 at 13:59 UTC
0bc72abdb0440f003169211f01b8f3ffb83291e4
3 files changed
+16
-3
Documentation/git-tag.txt
+6
-1
@@ -9,7 +9,7 @@ git-tag - Create a tag object signed with GPG
9
SYNOPSIS
10
--------
11
[verse]
12
-'git-tag' [-a | -s | -u <key-id>] [-f | -d] [-m <msg> | -F <file>]
12
+'git-tag' [-a | -s | -u <key-id>] [-f | -d | -v] [-m <msg> | -F <file>]
13
<name> [<head>]
14
'git-tag' -l [<pattern>]
15
@@ -35,6 +35,8 @@ GnuPG key for signing.
35
36
`-d <tag>` deletes the tag.
37
38
+`-v <tag>` verifies the gpg signature of the tag.
39
+
40
`-l <pattern>` lists tags that match the given pattern (or all
41
if no pattern is given).
42
@@ -55,6 +57,9 @@ OPTIONS
57
-d::
58
Delete an existing tag with the given name
59
60
+-v::
61
+ Verify the gpg signature of given the tag
62
+
63
-l <pattern>::
64
List tags that match the given pattern (or all if no pattern is given).
65
generate-cmdlist.sh
-1
@@ -37,7 +37,6 @@ show
37
show-branch
38
status
39
tag
40
-verify-tag
40
EOF
41
while read cmd
42
do
git-tag.sh
+10
-1
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
# Copyright (c) 2005 Linus Torvalds
3
4
-USAGE='-l [<pattern>] | [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <tagname> [<head>]'
4
+USAGE='-l [<pattern>] | [-a | -s | -u <key-id>] [-f | -d | -v] [-m <msg>] <tagname> [<head>]'
5
SUBDIRECTORY_OK='Yes'
6
. git-sh-setup
7
@@ -12,6 +12,7 @@ force=
12
message=
13
username=
14
list=
15
+verify=
16
while case "$#" in 0) break ;; esac
17
do
18
case "$1" in
@@ -69,6 +70,14 @@ do
70
echo "Deleted tag $tag_name."
71
exit $?
72
;;
73
+ -v)
74
+ shift
75
+ tag_name="$1"
76
+ tag=$(git-show-ref --verify --hash -- "refs/tags/$tag_name") ||
77
+ die "Seriously, what tag are you talking about?"
78
+ git-verify-tag -v "$tag"
79
+ exit $?
80
+ ;;
81
-*)
82
usage
83
;;