git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Potapov <dpotapov@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/2] Documentation: replace sha1 by SHA-1
Date: Sat, 25 Apr 2009 16:13:07 +0400	[thread overview]
Message-ID: <20090425121307.GA20459@dpotapov.dyndns.org> (raw)
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:

> @@ -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

      parent reply	other threads:[~2009-04-25 12:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24 14:49 [PATCH 0/2] Unify use of [sha,SHA][,-]1 Michael J Gruber
2009-04-24 14:49 ` [PATCH 1/2] Documentation: replace sha1 by SHA-1 Michael J Gruber
2009-04-24 14:49   ` [PATCH 2/2] Documentation: replace SHA1 " Michael J Gruber
2009-04-24 21:30     ` Jeff King
2009-04-24 15:18   ` [PATCH 1/2] Documentation: replace sha1 " Johannes Sixt
2009-04-24 15:23     ` Wincent Colaiuta
2009-04-24 15:33       ` Michael J Gruber
2009-04-24 15:30     ` Michael J Gruber
2009-04-24 21:28   ` Jeff King
2009-04-24 22:38     ` Junio C Hamano
2009-04-25 10:47       ` Felipe Contreras
2009-04-25 12:13   ` Dmitry Potapov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090425121307.GA20459@dpotapov.dyndns.org \
    --to=dpotapov@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).