Browse Source

git-tag -d: allow deleting multiple tags at once.

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Junio C Hamano 18 years ago
parent
commit
453c1e8575
  1. 8
      Documentation/git-tag.txt
  2. 21
      git-tag.sh

8
Documentation/git-tag.txt

@ -3,14 +3,14 @@ git-tag(1)


NAME NAME
---- ----
git-tag - Create or verify a tag object signed with GPG git-tag - Create, list, delete or verify a tag object signed with GPG




SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git-tag' [-a | -s | -u <key-id>] [-f | -d | -v] [-m <msg> | -F <file>] 'git-tag' [-a | -s | -u <key-id>] [-f | -v] [-m <msg> | -F <file>] <name> [<head>]
<name> [<head>] 'git-tag' -d <name>...
'git-tag' -l [<pattern>] 'git-tag' -l [<pattern>]


DESCRIPTION DESCRIPTION
@ -55,7 +55,7 @@ OPTIONS
Replace an existing tag with the given name (instead of failing) Replace an existing tag with the given name (instead of failing)


-d:: -d::
Delete an existing tag with the given name Delete existing tags with the given names.


-v:: -v::
Verify the gpg signature of given the tag Verify the gpg signature of given the tag

21
git-tag.sh

@ -63,12 +63,21 @@ do
;; ;;
-d) -d)
shift shift
tag_name="$1" had_error=0
tag=$(git-show-ref --verify --hash -- "refs/tags/$tag_name") || for tag
die "Seriously, what tag are you talking about?" do
git-update-ref -m 'tag: delete' -d "refs/tags/$tag_name" "$tag" && cur=$(git-show-ref --verify --hash -- "refs/tags/$tag") || {
echo "Deleted tag $tag_name." echo >&2 "Seriously, what tag are you talking about?"
exit $? had_error=1
continue
}
git-update-ref -m 'tag: delete' -d "refs/tags/$tag" "$cur" || {
had_error=1
continue
}
echo "Deleted tag $tag."
done
exit $had_error
;; ;;
-v) -v)
shift shift

Loading…
Cancel
Save