Skip to contentSkip to conversation

sha-1 mismatch using command line sha1sum

DISCUSSION Andy Parkins 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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? :-)

Andy

Signature · 2 lines
Dr Andy Parkins, M Eng (hons), MIEE
[email protected]
#1 lore raw
Quoted 9 lines · Andy Parkins

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:

Quoted 7 lines
$ 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

#2 lore raw
Quoted 1 line · Baz

That changed some time ago. From the git(7) manpage:

Oh good. I have to admit, I started sweating a bit at the thought that the hashes might be wrong :-) I should know better; git is infalliable :-)

Andy

Signature · 2 lines
Dr Andy Parkins, M Eng (hons), MIEE
[email protected]
#3 lore raw
In reply to Andy Parkins
Quoted 9 lines · Andy Parkins

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:

Quoted 7 lines
$ 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? :-)

sha-1 sum of _uncompressed_ object.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git