Web lists-archives.com

No clear API/Error message to validate a "revision object" using git rev-parse

Hello there everyone,

Minor bug report:
I have a utility script to find "reference points" that contain a
commit (git-x-in-y)

The script needs to accept "any valid reference point", that includes
e.g. tags as well.
I validate said input by passing whatever argument through git rev-parse.

If the tag name is invalid, say:
$ git rev-parse version.3
fatal: ambiguous argument 'version.3': unknown revision or path not in
the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

So, I follow the recommendation to add '--', since I know that I won't
be adding any paths:

$ git rev-parse version.3 --
fatal: bad revision 'version.3'

However, what happens with the correct tags is, I get the trailing
double dash in:
$  git rev-parse version-0.false --

A further leading argument, e.g. '' makes the situation worse:
$ git rev-parse version-0.false -- ''


`--verify`s error message is even more cryptic:
$ git rev-parse --verify version.3
fatal: Needed a single revision
$ git rev-parse --verify version-0.false

Further attempts do not help either:
$  git rev-parse --revs-only version-3 ; echo $?

Am I writing the command wrong, or is there some part of it I don't understand?

Ntentos Stavros