git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] Fix git-verify-tag for local tags

From
PGPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Date
Oct 9, 2005, 18:12 UTC
Message-ID
<20051009181246.17885.81654.stgit@zion.home.lan>
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: Paolo 'Blaisorblade' Giarrusso
Message 1 of 3 in “Fix git-verify-tag for local tags”
  1. 1/2 Fix git-verify-tag for local tagsPaolo 'Blaisorblade' Giarrusso, Oct 9, 2005
  2. 2/2 git-verify-tag: detect wrong syntaxPaolo 'Blaisorblade' Giarrusso, Oct 9, 2005
  3. Junio C HamanoOct 9, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.