From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH 1/2] Fix git-verify-tag for local tags
Date: Sun, 09 Oct 2005 20:12:47 +0200 [thread overview]
Message-ID: <20051009181246.17885.81654.stgit@zion.home.lan> (raw)
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
It currently exits printing "git-cat-file SHA1: bad file", while instead we must
just abort the verification for local tags (i.e. referring to commit objects).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
git-verify-tag.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/git-verify-tag.sh b/git-verify-tag.sh
--- a/git-verify-tag.sh
+++ b/git-verify-tag.sh
@@ -3,6 +3,10 @@
tag=$(git-rev-parse $1) || exit 1
+type=$(git-cat-file -t $tag) || exit 1
+[ "$type" = "commit" ] && die "Light tag - verification impossible"
+[ "$type" = "tag" ] || die "Bad tag - SHA1 doesn't refer to a tag object nor to a commit one."
+
git-cat-file tag $tag > .tmp-vtag || exit 1
cat .tmp-vtag | sed '/-----BEGIN PGP/Q' | gpg --verify .tmp-vtag - || exit 1
rm -f .tmp-vtag
next reply other threads:[~2005-10-09 18:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-09 18:12 Paolo 'Blaisorblade' Giarrusso [this message]
2005-10-09 18:12 ` [PATCH 2/2] git-verify-tag: detect wrong syntax Paolo 'Blaisorblade' Giarrusso
2005-10-09 19:29 ` [PATCH 1/2] Fix git-verify-tag for local tags Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051009181246.17885.81654.stgit@zion.home.lan \
--to=blaisorblade@yahoo.it \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox