2005-06-27 00:38:47 +00:00
|
|
|
#!/bin/sh
|
2005-11-28 07:19:58 +00:00
|
|
|
|
2005-12-13 22:30:31 +00:00
|
|
|
USAGE='<tag>'
|
|
|
|
SUBDIRECTORY_OK='Yes'
|
|
|
|
. git-sh-setup
|
2005-06-27 00:38:47 +00:00
|
|
|
|
2006-03-02 00:43:19 +00:00
|
|
|
verbose=
|
|
|
|
while case $# in 0) break;; esac
|
|
|
|
do
|
|
|
|
case "$1" in
|
|
|
|
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
|
|
|
|
verbose=t ;;
|
|
|
|
*)
|
|
|
|
break ;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2005-12-13 22:30:31 +00:00
|
|
|
if [ "$#" != "1" ]
|
|
|
|
then
|
2006-03-02 00:43:19 +00:00
|
|
|
usage
|
2005-12-13 22:30:31 +00:00
|
|
|
fi
|
2005-11-28 07:33:54 +00:00
|
|
|
|
2007-07-03 05:52:14 +00:00
|
|
|
type="$(git cat-file -t "$1" 2>/dev/null)" ||
|
2005-10-09 23:50:34 +00:00
|
|
|
die "$1: no such object."
|
2005-06-27 00:38:47 +00:00
|
|
|
|
2005-10-09 23:50:34 +00:00
|
|
|
test "$type" = tag ||
|
|
|
|
die "$1: cannot verify a non-tag object of type $type."
|
|
|
|
|
2006-03-02 00:43:19 +00:00
|
|
|
case "$verbose" in
|
|
|
|
t)
|
2007-07-03 05:52:14 +00:00
|
|
|
git cat-file -p "$1" |
|
2006-03-02 00:43:19 +00:00
|
|
|
sed -n -e '/^-----BEGIN PGP SIGNATURE-----/q' -e p
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2007-01-03 20:34:20 +00:00
|
|
|
trap 'rm -f "$GIT_DIR/.tmp-vtag"' 0
|
|
|
|
|
2007-07-03 05:52:14 +00:00
|
|
|
git cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
|
2007-06-30 06:42:47 +00:00
|
|
|
sed -n -e '
|
|
|
|
/^-----BEGIN PGP SIGNATURE-----$/q
|
|
|
|
p
|
|
|
|
' <"$GIT_DIR/.tmp-vtag" |
|
2005-11-28 07:19:58 +00:00
|
|
|
gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
|
|
|
|
rm -f "$GIT_DIR/.tmp-vtag"
|