aboutsummaryrefslogtreecommitdiff
path: root/git-verify-tag.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-01 16:43:19 -0800
committerJunio C Hamano <junkio@cox.net>2006-03-01 17:06:20 -0800
commita0f15fa502d4451a1d0041a431f43ff5519536dd (patch)
treead606c2ff5a67aad86f8e43fb43632cea77ad416 /git-verify-tag.sh
parente1a0c8b1483b38d32d3870408e03a6c1b340aa15 (diff)
downloadgit-a0f15fa502d4451a1d0041a431f43ff5519536dd.tar.gz
git-a0f15fa502d4451a1d0041a431f43ff5519536dd.tar.xz
Pretty-print tagger dates.
We can show commit objects with human readable dates using various --pretty options, but there was no way to do so with tags. This introduces two such ways: $ git-cat-file -p v1.2.3 shows the tag object with tagger dates in human readable format. $ git-verify-tag --verbose v1.2.3 uses it to show the contents of the tag object as well as doing GPG verification. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-verify-tag.sh')
-rwxr-xr-xgit-verify-tag.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/git-verify-tag.sh b/git-verify-tag.sh
index 726b1e706..36f171b30 100755
--- a/git-verify-tag.sh
+++ b/git-verify-tag.sh
@@ -4,9 +4,21 @@ USAGE='<tag>'
SUBDIRECTORY_OK='Yes'
. git-sh-setup
+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
+
if [ "$#" != "1" ]
then
- usage
+ usage
fi
type="$(git-cat-file -t "$1" 2>/dev/null)" ||
@@ -15,6 +27,13 @@ type="$(git-cat-file -t "$1" 2>/dev/null)" ||
test "$type" = tag ||
die "$1: cannot verify a non-tag object of type $type."
+case "$verbose" in
+t)
+ git-cat-file -p "$1" |
+ sed -n -e '/^-----BEGIN PGP SIGNATURE-----/q' -e p
+ ;;
+esac
+
git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
cat "$GIT_DIR/.tmp-vtag" |
sed '/-----BEGIN PGP/Q' |