git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[DOC] name-rev: --annotate-stdin docs still describe SHA-1

From
JKjyotish kumar <jyotishkumar725015@gmail.com>
Date
Sep 27, 2026, 09:54 UTC
Message-ID
<CAGjZMyTrA4Fre7kaTq_=QGyobdEgC0a7U6-94n4qehBWMwn3uQ@mail.gmail.com>
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

Next: brian m. carlson
Message 1 of 5 in “[DOC] name-rev: --annotate-stdin docs still describe SHA-1”
  1. jyotish kumarSep 27, 2026
  2. brian m. carlsonSep 27, 2026
  3. name-rev: update hash descriptionsjyotish kumar, Sep 27, 2026
  4. brian m. carlsonSep 27, 2026
  5. Junio C HamanoSep 27, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.