summaryrefslogtreecommitdiff
path: root/git-verify-tag.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-02 00:43:19 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-02 01:06:20 (GMT)
commita0f15fa502d4451a1d0041a431f43ff5519536dd (patch)
treead606c2ff5a67aad86f8e43fb43632cea77ad416 /git-verify-tag.sh
parente1a0c8b1483b38d32d3870408e03a6c1b340aa15 (diff)
downloadgit-a0f15fa502d4451a1d0041a431f43ff5519536dd.zip
git-a0f15fa502d4451a1d0041a431f43ff5519536dd.tar.gz
git-a0f15fa502d4451a1d0041a431f43ff5519536dd.tar.bz2
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 726b1e7..36f171b 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' |