summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8cb711c)
raw | patch | inline | side by side (parent: 8cb711c)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 17 Feb 2006 12:04:39 +0000 (04:04 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 17 Feb 2006 12:04:39 +0000 (04:04 -0800) |
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>
result with <pattern>.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-tag.txt | patch | blob | history | |
git-tag.sh | patch | blob | history |
index e8892bb0b05884c379b9b32548c799bd0aca6f1b..e1c76c600df3ae5fa78770b30f1309993b3e9326 100644 (file)
SYNOPSIS
--------
+[verse]
'git-tag' [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <name> [<head>]
+'git-tag' -l [<pattern>]
DESCRIPTION
-----------
-Adds a 'tag' reference in .git/refs/tags/
+Adds a 'tag' reference in `.git/refs/tags/`
Unless `-f` is given, the tag must not yet exist in
`.git/refs/tags/` directory.
`-d <tag>` deletes the tag.
+`-l <pattern>` lists tags that match the given pattern (or all
+if no pattern is given).
+
OPTIONS
-------
-a::
-d::
Delete an existing tag with the given name
+-l <pattern>::
+ List tags that match the given pattern (or all if no pattern is given).
+
-m <msg>::
Use the given tag message (instead of prompting)
diff --git a/git-tag.sh b/git-tag.sh
index c74e1b4151a3d05a5825dc7dcba2dfaf1ad9a0fa..76e51ed174c3f8e752d221374ec83b1f1db7fde5 100755 (executable)
--- a/git-tag.sh
+++ b/git-tag.sh
#!/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
force=
message=
username=
+list=
while case "$#" in 0) break ;; esac
do
case "$1" in
-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