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

Re: sha-1 mismatch using command line sha1sum

From
Baz <brian.ewins@gmail.com>
Date
Jan 16, 2007, 13:50 UTC
Message-ID
<2faad3050701160550g2d3fdf56p64b8ae1ea4d4197e@mail.gmail.com>
In-Reply-To
<200701161342.56431.andyparkins@gmail.com>
On 16/01/07, Andy Parkins <andyparkins@gmail.com> wrote:
Show 16 quoted lines
> Hello,
>
> I came across this message:
>
> http://www.gelato.unsw.edu.au/archives/git/0504/0212.html
>
> So I thought, "hey that's interesting, I'll try it".  I was surprised to find
> this:
>
> $ sha1sum .git/objects/f4/b6c6b90fdce12d69e4ad80ff6082405ec8cfb8
> ac4c6f1d36d6e0341486789b32f86ae6f506df35  .git/objects/f4/b6c6b90fdce12d69e4ad80ff6082405ec8cfb8
>
> This is in the latest git repository.
>
> Is this correct, or should we all begin screaming and crying that our
> repositories are woefully corrupt? :-)
That changed some time ago. From the git(7) manpage:

"It's worth noting that the SHA1 hash that is used to name the object is the hash of the original data plus this header, so sha1sum file does not match the object name for file. (Historical note: in the dawn of the age of git the hash was the sha1 of the compressed object.)"

Cheers, Baz

Previous: Andy ParkinsNext: Andy Parkins
Message 2 of 4 in “sha-1 mismatch using command line sha1sum”
  1. Andy ParkinsJan 16, 2007
  2. BazJan 16, 2007
  3. Andy ParkinsJan 16, 2007
  4. Jakub NarebskiJan 16, 2007

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.