#!/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
exit 1
}
- ( echo -e "object $object\ntype $type\ntag $name\ntagger $tagger\n";
+ ( printf 'object %s\ntype %s\ntag %s\ntagger %s\n\n' \
+ "$object" "$type" "$name" "$tagger";
cat "$GIT_DIR"/TAG_FINALMSG ) >"$GIT_DIR"/TAG_TMP
rm -f "$GIT_DIR"/TAG_TMP.asc "$GIT_DIR"/TAG_FINALMSG
if [ "$signed" ]; then