As @torek points out, in this case 539f065446a993825d61dddc5d9dc72ae54d7a29
is not a commit hash but a ref to annotated tag object (vs lightweight tags) so it is not among commits refs. For this exact opencv
project
$ cat .git/refs/tags/4.2.0
539f065446a993825d61dddc5d9dc72ae54d7a29
You can see the tagged commit ref and tag's ref as @flaxel points (the second is tag's related commit hash)
$ git show-ref --tags -d
...
539f065446a993825d61dddc5d9dc72ae54d7a29 refs/tags/4.2.0
bda89a6469aa79ecd8713967916bd754bff1d931 refs/tags/4.2.0^{}
...
$ git cat-file -t 539f065446a993825d61dddc5d9dc72ae54d7a29
tag
$ git cat-file -t bda89a6469aa79ecd8713967916bd754bff1d931
commit
$ git show-ref --head
0052d46b8e33c7bfe0e1450e4bff28b88f455570 HEAD
0052d46b8e33c7bfe0e1450e4bff28b88f455570 refs/heads/master
...
539f065446a993825d61dddc5d9dc72ae54d7a29 refs/tags/4.2.0
...
Annotated tag objects have extra meta data (tagger's name, email, date, message)
$ git show 539f065446a993825d61dddc5d9dc72ae54d7a29
tag 4.2.0
Tagger: Alexander Alekhin <alexander.alekhin@intel.com>
Date: Fri Dec 20 16:44:16 2019 +0300
OpenCV 4.2.0
commit bda89a6469aa79ecd8713967916bd754bff1d931 (tag: 4.2.0)
Author: Alexander Alekhin <alexander.alekhin@intel.com>
Date: Fri Dec 20 16:44:16 2019 +0300
release: OpenCV 4.2.0
...
Annotated tag can be created with
git tag -a v1.0 -m "Adding tag 1.0 (tag's message)"