• Print the object name of the current commit:
$ git rev-parse --verify HEAD
• Print the commit object name from the revision in the $REV
shell variable:
$ git rev-parse --verify --end-of-options $REV^{commit}
This will error out if $REV is empty or not a valid revision.
• Similar to above:
$ git rev-parse --default master --verify --end-of-options $REV
but if $REV is empty, the commit object name from master will
be printed.