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

Re: Lets avoid the SHA-1 term (was [doc] User Manual Suggestion)

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
May 2, 2009, 15:37 UTC
Message-ID
<20090502153734.GA6135@atjola.homenet>
In-Reply-To
<b4087cc50904270602q17fba432ka219180d358fae47@mail.gmail.com>
On 2009.04.27 08:02:02 -0500, Michael Witten wrote:
Show 22 quoted lines
> 2009/4/26 Björn Steinbrink <B.Steinbrink@gmx.de>:
> >
> >> Do you agree that either 'id' or 'hash' would work fine?
> >
> > "object id" would work for me, but I'm fine with the existing "object
> > name" as well. I don't like "object hash" (or "object hash id"), because
> > it IMHO doesn't express that well that it's used to identify an object.
> 
> However, the SHA-1 hash is not actually essential to git. In the git
> world, there is only content and every object is identified by its
> content. Now, to identify an object, it would be pretty cumbersome to
> have to write out the contents, so we abbreviate the contents with a
> hash.
> 
> So, the hash or object name or object id or whatever you want to call
> it isn't even an essential part to git. It is a convenience.
> 
> In that sense, I think that '[cryptographic] hash' is the right term,
> because the others ("object name" and "object id") seem special. A
> hash is not special. In fact, the documentation should read "For
> convenience, the git tools refer to objects using the hash value of
> their contents". You see? It's not essential.

"For convenience" means "To make it suck less for the user" to me. And that's why you can use an abbreviated object name as long as its unique.

That a hash is used isn't essential for the basic data model, where commits reference trees which in turn reference other trees and blobs. To understand that model, it's not essential to know that hashes are used. But it is essential that some kind of identifier other than the whole content is used. Otherwise, the whole data model would make no sense at all. If you use the whole content to identify an object, that means that commits contain the whole trees which in turn contain the whole other trees and the whole blobs. So you could as well just have only commit objects, they contain everything anyway.

So that we have the object name instead of the whole content _is_ essential.

Björn
Previous: Michael WittenNext: Michael J Gruber
Message 4 of 5 in “Lets avoid the SHA-1 term (was [doc] User Manual Suggestion)”
  1. Felipe ContrerasApr 26, 2009
  2. Björn SteinbrinkApr 27, 2009
  3. Michael WittenApr 27, 2009
  4. Björn SteinbrinkMay 2, 2009
  5. Michael J GruberApr 27, 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.