summaryrefslogtreecommitdiff
path: root/git-tag.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-17 12:04:39 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-17 12:04:39 (GMT)
commitb867c7c23a42fbe9f261153a9814a5efbc071a29 (patch)
tree3f35a4d9ce1625eba095e48ace247d0ec65d2f55 /git-tag.sh
parent8cb711c8a5f98c1556b320114d7cc65e498ee2ae (diff)
downloadgit-b867c7c23a42fbe9f261153a9814a5efbc071a29.zip
git-b867c7c23a42fbe9f261153a9814a5efbc071a29.tar.gz
git-b867c7c23a42fbe9f261153a9814a5efbc071a29.tar.bz2
git-tag: -l to list tags (usability).
git-tag -l lists all tags, and git-tag -l <pattern> filters the result with <pattern>. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-tag.sh')
-rwxr-xr-xgit-tag.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/git-tag.sh b/git-tag.sh
index c74e1b4..76e51ed 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (c) 2005 Linus Torvalds
-USAGE='[-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <tagname> [<head>]'
+USAGE='-l [<pattern>] | [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <tagname> [<head>]'
SUBDIRECTORY_OK='Yes'
. git-sh-setup
@@ -10,6 +10,7 @@ signed=
force=
message=
username=
+list=
while case "$#" in 0) break ;; esac
do
case "$1" in
@@ -23,6 +24,17 @@ do
-f)
force=1
;;
+ -l)
+ cd "$GIT_DIR/refs" &&
+ case "$#" in
+ 1)
+ find tags -type f -print ;;
+ *)
+ shift
+ find tags -type f -print | grep "$@" ;;
+ esac
+ exit $?
+ ;;
-m)
annotate=1
shift