News for hackers. Stuff that matters.
Re:The beginning of Git supporting other hash algorithms by jffry on Sunday March 19, 2017 @10:13AM (#13907168)
If you have a repo with a lot of GPG signed commits, or you just don't want to change all your commit IDs (because you reference them in other places), then it'd be very valuable to be able to have a repo that's mixed old and new hashes.

Also your Git binary, if compiled with only the One True Hash™, wouldn't be able to work with older repos at all because the hashes it's calculating are now different.

(Edit: Another benefit of generalizing this is so that if/when, in the future, the new hash algorithm must be abandoned due to weaknesses, Git tooling will have been already introduced to the notion that hashes can be different and should hopefully be a less involved migration the next time around)

Re:The beginning of Git supporting other hash algorithms by loeg on Sunday March 19, 2017 @11:46AM (#13907770)
The one typedef could have just been changed from char[20] to 'struct objectid' to support multiple hash types.
Re:The beginning of Git supporting other hash algorithms by hn_throwaway_99 on Sunday March 19, 2017 @12:44PM (#13908117)
It was, see comment from bk2204 above:

> Yes, this is correct. The struct object_id changes don't actually change the hash. What they do, however, is allow us to remove a lot of the hard-coded instances of 20 and 40 (SHA-1 length in bytes and hex, respectively) in the codebase.

Re:The beginning of Git supporting other hash algorithms by loeg on Sunday March 19, 2017 @01:32PM (#13908454)
No. We're talking about zoren's hypothetical case where git used a typedef from the beginning, instead of littering char[20]s all over the tree.

My prior comment was explaining why jffry's complaint is nonsensical (a typedef does not prevent moving from a single hash model to a multiple simultaneous hash model).

Re:The beginning of Git supporting other hash algorithms by hn_throwaway_99 on Sunday March 19, 2017 @01:49PM (#13908561)
Hmm, not sure where there disagreement is, that's exactly what I'm saying. Obviously it wasn't done from the beginning, but the code is now changing from the char[20]s everywhere to the typedef precisely to be able support multiple hash functions.