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

Re: [PATCH 1/2] Documentation: replace sha1 by SHA-1

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Apr 25, 2009, 12:13 UTC
Message-ID
<20090425121307.GA20459@dpotapov.dyndns.org>
In-Reply-To
<1240584575-5702-2-git-send-email-git@drmicha.warpmail.net>
On Fri, Apr 24, 2009 at 04:49:34PM +0200, Michael J Gruber wrote:
> Replace sha1 by SHA-1 with the following exceptions:

I seriously doubt that mentioning any particular hash algorithm (which is implementation detail) in so many places make much sense. IMHO, it would be much better to use some general name as hash-id or something.

Besides, mentioning SHA-1 may lead to confusion. Take a look at the following text:

Show 11 quoted lines
> @@ -164,10 +164,10 @@ Using --cacheinfo or --info-only
>  current working directory.  This is useful for minimum-checkout
>  merging.
>  
> -To pretend you have a file with mode and sha1 at path, say:
> +To pretend you have a file with mode and SHA-1 at path, say:
>  
>  ----------------
> -$ git update-index --cacheinfo mode sha1 path
> +$ git update-index --cacheinfo mode SHA-1 path
>  ----------------
This is incorrect, and here is why:

$ touch empty $ git hash-object empty e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 $ sha1sum empty da39a3ee5e6b4b0d3255bfef95601890afd80709 empty

What should be given to git update-index is the hash produced by git hash-object and NOT SHA-1 of the file. (Yes, git hash-object does use SHA-1, but I seriously doubt that any Git user needs to know how git hash-object calculates the hash.)

So, I hardly see how a mechanical replacement of sha1 with SHA-1 can be any improvement. While, at least, sha1 can be interpreted as SHA-1 based hash value returned by git-hash-object, your patch only enforces the misconception that we are dealing with SHA-1 of the file here.

Dmitry
Previous: Felipe Contreras
Message 12 of 12 in “Unify use of [sha,SHA][,-]1”
  1. 0/2 Unify use of [sha,SHA][,-]1Michael J Gruber, Apr 24, 2009
  2. 1/2 Documentation: replace sha1 by SHA-1Michael J Gruber, Apr 24, 2009
  3. 2/2 Documentation: replace SHA1 by SHA-1Michael J Gruber, Apr 24, 2009
  4. Jeff KingApr 24, 2009
  5. Johannes SixtApr 24, 2009
  6. Wincent ColaiutaApr 24, 2009
  7. Michael J GruberApr 24, 2009
  8. Michael J GruberApr 24, 2009
  9. Jeff KingApr 24, 2009
  10. Junio C HamanoApr 24, 2009
  11. Felipe ContrerasApr 25, 2009
  12. Dmitry PotapovApr 25, 2009

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.