From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Print proper error messages when failing, and handle -h/--help to avoid, if possible, to print double error message (from git-cat-file and from git-verify-tag). Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> --- git-verify-tag.sh | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/git-verify-tag.sh b/git-verify-tag.sh --- a/git-verify-tag.sh +++ b/git-verify-tag.sh @@ -1,9 +1,16 @@ #!/bin/sh . git-sh-setup || die "Not a git archive" +usage() { + die "usage: git-verify-tag <tag>" +} + +[ $# = 1 ] || usage +[ "$1" = "-h" -o "$1" = "--help" ] && usage + tag=$(git-rev-parse $1) || exit 1 -type=$(git-cat-file -t $tag) || exit 1 +type=$(git-cat-file -t $tag) || usage [ "$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." - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htmlReceived on Mon Oct 10 04:53:49 2005
This archive was generated by hypermail 2.1.8 : 2005-10-10 04:54:23 EST