projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git-mv: shrink usage, no usage on error
[git.git]
/
git-tag.sh
diff --git
a/git-tag.sh
b/git-tag.sh
index
bd92753
..
16efc5b
100755
(executable)
--- a/
git-tag.sh
+++ b/
git-tag.sh
@@
-1,10
+1,10
@@
#!/bin/sh
# Copyright (c) 2005 Linus Torvalds
#!/bin/sh
# Copyright (c) 2005 Linus Torvalds
-. git-sh-setup
|| die "Not a git archive"
+. git-sh-setup
usage () {
usage () {
- echo >&2 "Usage: git-tag [-a | -s | -u <key-id>] [-f] [-m <msg>] <tagname> [<head>]"
+ echo >&2 "Usage: git-tag [-a | -s | -u <key-id>] [-f
| -d
] [-m <msg>] <tagname> [<head>]"
exit 1
}
exit 1
}
@@
-37,6
+37,13
@@
do
shift
username="$1"
;;
shift
username="$1"
;;
+ -d)
+ shift
+ tag_name="$1"
+ rm "$GIT_DIR/refs/tags/$tag_name" && \
+ echo "Deleted tag $tag_name."
+ exit $?
+ ;;
-*)
usage
;;
-*)
usage
;;
@@
-92,5
+99,6
@@
if [ "$annotate" ]; then
object=$(git-mktag < "$GIT_DIR"/TAG_TMP)
fi
object=$(git-mktag < "$GIT_DIR"/TAG_TMP)
fi
-mkdir -p "$GIT_DIR/refs/tags"
+leading=`expr "refs/tags/$name" : '\(.*\)/'` &&
+mkdir -p "$GIT_DIR/$leading" &&
echo $object > "$GIT_DIR/refs/tags/$name"
echo $object > "$GIT_DIR/refs/tags/$name"