{"thread":{"id":"66399","subject":"[DOC] name-rev: --annotate-stdin docs still describe SHA-1","startedAt":"2026-09-27T09:55:10Z","lastAt":"2026-09-27T22:58:42Z","messageCount":5,"participants":["jyotish kumar","brian m. carlson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"553371","messageId":"CAGjZMyTrA4Fre7kaTq_=QGyobdEgC0a7U6-94n4qehBWMwn3uQ@mail.gmail.com","threadId":"66399","inReplyTo":null,"subject":"[DOC] name-rev: --annotate-stdin docs still describe SHA-1","fromName":"jyotish kumar","fromEmail":"jyotishkumar725015@gmail.com","sentAt":"2026-09-27T09:54:58Z","receivedAt":"2026-09-27T09:55:10Z","isPatch":false,"body":"Hi,\n\nI noticed that the documentation for `git name-rev --annotate-stdin`\nstill describes the input as 40-character SHA-1 hexes:\n\n    Transform stdin by substituting all the 40-character SHA-1\n    hexes (say $hex) with \"$hex ($rev_name)\".\n\nThe implementation of `name_rev_line()` uses the active hash\nalgorithm's hexadecimal size:\n\n    const unsigned hexsz = the_hash_algo->hexsz;\n\nand uses `hexsz` when determining the length of the hexadecimal\nobject ID rather than a hard-coded SHA-1 length.\n\nThis hash-size-independent parsing was introduced by commit\n1c4675dc57 (\"builtin/name-rev: make hash-size independent\"), which\nsays:\n\n    Use the_hash_algo when parsing instead of GIT_SHA1_HEXSZ so that\n    this function works with any size hash.\n\nThere is also a related SHA-1-specific description under `--name-only`:\n\n    Instead of printing both the SHA-1 and the name, print only\n    the name.\n\nWould it make sense to update these descriptions to refer to the\nobject ID length used by the selected hash algorithm, rather than\nspecifically referring to SHA-1?\n\nIf this is considered a documentation bug, I would be happy to prepare\na small patch.\n\nThanks,\nJyotish Kumar\n"},{"id":"553384","messageId":"arkfFUpCskucD7Nh@fruit.crustytoothpaste.net","threadId":"66399","inReplyTo":"CAGjZMyTrA4Fre7kaTq_=QGyobdEgC0a7U6-94n4qehBWMwn3uQ@mail.gmail.com","subject":"Re: [DOC] name-rev: --annotate-stdin docs still describe SHA-1","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-09-27T13:50:14Z","receivedAt":"2026-09-27T13:55:49Z","isPatch":false,"body":"On 2026-09-27 at 09:54:58, jyotish kumar wrote:\n> Hi,\n\nHey,\n\n> Would it make sense to update these descriptions to refer to the\n> object ID length used by the selected hash algorithm, rather than\n> specifically referring to SHA-1?\n> \n> If this is considered a documentation bug, I would be happy to prepare\n> a small patch.\n\nYes, I think this is a documentation bug and a patch would be welcome.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"553391","messageId":"20260927194602.86750-1-jyotishkumar725015@gmail.com","threadId":"66399","inReplyTo":"arkfFUpCskucD7Nh@fruit.crustytoothpaste.net","subject":"[PATCH] name-rev: update hash descriptions","fromName":"jyotish kumar","fromEmail":"jyotishkumar725015@gmail.com","sentAt":"2026-09-27T19:46:02Z","receivedAt":"2026-09-27T19:52:08Z","isPatch":true,"body":"The documentation for --annotate-stdin and --name-only refers to\nSHA-1, although name-rev handles object IDs according to the active\nhash algorithm.\n\nUpdate the descriptions to refer to object IDs instead.\n\nSigned-off-by: jyotish kumar <jyotishkumar725015@gmail.com>\n---\n Documentation/git-name-rev.adoc | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-name-rev.adoc b/Documentation/git-name-rev.adoc\nindex d4f1c4d594..9837fe59b3 100644\n--- a/Documentation/git-name-rev.adoc\n+++ b/Documentation/git-name-rev.adoc\n@@ -43,7 +43,7 @@ OPTIONS\n \tList all commits reachable from all refs\n \n --annotate-stdin::\n-\tTransform stdin by substituting all the 40-character SHA-1\n+\tTransform stdin by substituting all the full-length object ID\n \thexes (say $hex) with \"$hex ($rev_name)\".  When used with\n \t--name-only, substitute with \"$rev_name\", omitting $hex\n \taltogether. This option was called `--stdin` in older versions\n@@ -72,7 +72,7 @@ while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad\n -----------\n \n --name-only::\n-\tInstead of printing both the SHA-1 and the name, print only\n+\tInstead of printing both the object ID and the name, print only\n \tthe name.  If given with --tags the usual tag prefix of\n \t\"tags/\" is also omitted from the name, matching the output\n \tof `git-describe` more closely.\n-- \n2.43.0\n\n"},{"id":"553393","messageId":"armZ28MWl9dTHDz6@fruit.crustytoothpaste.net","threadId":"66399","inReplyTo":"20260927194602.86750-1-jyotishkumar725015@gmail.com","subject":"Re: [PATCH] name-rev: update hash descriptions","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-09-27T22:34:03Z","receivedAt":"2026-09-27T22:34:05Z","isPatch":true,"body":"On 2026-09-27 at 19:46:02, jyotish kumar wrote:\n> The documentation for --annotate-stdin and --name-only refers to\n> SHA-1, although name-rev handles object IDs according to the active\n> hash algorithm.\n> \n> Update the descriptions to refer to object IDs instead.\n> \n> Signed-off-by: jyotish kumar <jyotishkumar725015@gmail.com>\n> ---\n>  Documentation/git-name-rev.adoc | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/Documentation/git-name-rev.adoc b/Documentation/git-name-rev.adoc\n> index d4f1c4d594..9837fe59b3 100644\n> --- a/Documentation/git-name-rev.adoc\n> +++ b/Documentation/git-name-rev.adoc\n> @@ -43,7 +43,7 @@ OPTIONS\n>  \tList all commits reachable from all refs\n>  \n>  --annotate-stdin::\n> -\tTransform stdin by substituting all the 40-character SHA-1\n> +\tTransform stdin by substituting all the full-length object ID\n>  \thexes (say $hex) with \"$hex ($rev_name)\".  When used with\n>  \t--name-only, substitute with \"$rev_name\", omitting $hex\n>  \taltogether. This option was called `--stdin` in older versions\n> @@ -72,7 +72,7 @@ while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad\n>  -----------\n>  \n>  --name-only::\n> -\tInstead of printing both the SHA-1 and the name, print only\n> +\tInstead of printing both the object ID and the name, print only\n>  \tthe name.  If given with --tags the usual tag prefix of\n>  \t\"tags/\" is also omitted from the name, matching the output\n>  \tof `git-describe` more closely.\n\nThis looks much better.  I didn't see any other instances of \"SHA-1\" in\nthe documentation or \"40\", so this looks complete.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"553396","messageId":"xmqqbj9iqp27.fsf@gitster.g","threadId":"66399","inReplyTo":"armZ28MWl9dTHDz6@fruit.crustytoothpaste.net","subject":"Re: [PATCH] name-rev: update hash descriptions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-27T22:58:40Z","receivedAt":"2026-09-27T22:58:42Z","isPatch":true,"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n>>  --name-only::\n>> -\tInstead of printing both the SHA-1 and the name, print only\n>> +\tInstead of printing both the object ID and the name, print only\n>>  \tthe name.  If given with --tags the usual tag prefix of\n>>  \t\"tags/\" is also omitted from the name, matching the output\n>>  \tof `git-describe` more closely.\n>\n> This looks much better.  I didn't see any other instances of \"SHA-1\" in\n> the documentation or \"40\", so this looks complete.\n\nGreat to know that somebody already did the grep for us so I do not\nhave to ;-)\n\n\"object ID\" is the best one among a few synonyms to be used in the\ndescription of \"--name-only\", as the \"name\" is about the textual\n\"name\" name-rev mapped, and not about the \"object identifier\" that\nwas used as the input to the program.\n"}]}