Hi,
I noticed that the documentation for `git name-rev --annotate-stdin` still describes the input as 40-character SHA-1 hexes:
Transform stdin by substituting all the 40-character SHA-1
hexes (say $hex) with "$hex ($rev_name)".The implementation of `name_rev_line()` uses the active hash algorithm's hexadecimal size:
const unsigned hexsz = the_hash_algo->hexsz;
and uses `hexsz` when determining the length of the hexadecimal object ID rather than a hard-coded SHA-1 length.
This hash-size-independent parsing was introduced by commit 1c4675dc57 ("builtin/name-rev: make hash-size independent"), which says:
Use the_hash_algo when parsing instead of GIT_SHA1_HEXSZ so that
this function works with any size hash.There is also a related SHA-1-specific description under `--name-only`:
Instead of printing both the SHA-1 and the name, print only
the name.Would it make sense to update these descriptions to refer to the object ID length used by the selected hash algorithm, rather than specifically referring to SHA-1?
If this is considered a documentation bug, I would be happy to prepare a small patch.
Thanks, Jyotish Kumar