Git development
 help / color / mirror / Atom feed
* [DOC] name-rev: --annotate-stdin docs still describe SHA-1
@ 2026-09-27  9:54 jyotish kumar
  2026-09-27 13:50 ` brian m. carlson
  0 siblings, 1 reply; 5+ messages in thread
From: jyotish kumar @ 2026-09-27  9:54 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-27 22:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-27  9:54 [DOC] name-rev: --annotate-stdin docs still describe SHA-1 jyotish kumar
2026-09-27 13:50 ` brian m. carlson
2026-09-27 19:46   ` [PATCH] name-rev: update hash descriptions jyotish kumar
2026-09-27 22:34     ` brian m. carlson
2026-09-27 22:58       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox