git-tag -d: allow deleting multiple tags at once.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 20, 2007 at 10:47 UTC
453c1e857534f90b88367f96fc8ca1e7841f9400
2 files changed
+19
-10
Documentation/git-tag.txt
+4
-4
@@ -3,14 +3,14 @@ git-tag(1)
3
4
NAME
5
----
6
-git-tag - Create or verify a tag object signed with GPG
6
+git-tag - Create, list, delete or verify a tag object signed with GPG
7
8
9
SYNOPSIS
10
--------
11
[verse]
12
-'git-tag' [-a | -s | -u <key-id>] [-f | -d | -v] [-m <msg> | -F <file>]
13
- <name> [<head>]
12
+'git-tag' [-a | -s | -u <key-id>] [-f | -v] [-m <msg> | -F <file>] <name> [<head>]
13
+'git-tag' -d <name>...
14
'git-tag' -l [<pattern>]
15
16
DESCRIPTION
@@ -55,7 +55,7 @@ OPTIONS
55
Replace an existing tag with the given name (instead of failing)
56
57
-d::
58
- Delete an existing tag with the given name
58
+ Delete existing tags with the given names.
59
60
-v::
61
Verify the gpg signature of given the tag
git-tag.sh
+15
-6
@@ -63,12 +63,21 @@ do
63
;;
64
-d)
65
shift
66
- tag_name="$1"
67
- tag=$(git-show-ref --verify --hash -- "refs/tags/$tag_name") ||
68
- die "Seriously, what tag are you talking about?"
69
- git-update-ref -m 'tag: delete' -d "refs/tags/$tag_name" "$tag" &&
70
- echo "Deleted tag $tag_name."
71
- exit $?
66
+ had_error=0
67
+ for tag
68
+ do
69
+ cur=$(git-show-ref --verify --hash -- "refs/tags/$tag") || {
70
+ echo >&2 "Seriously, what tag are you talking about?"
71
+ had_error=1
72
+ continue
73
+ }
74
+ git-update-ref -m 'tag: delete' -d "refs/tags/$tag" "$cur" || {
75
+ had_error=1
76
+ continue
77
+ }
78
+ echo "Deleted tag $tag."
79
+ done
80
+ exit $had_error
81
;;
82
-v)
83
shift