3 ms·
Why doesn't git upon commit ensure the sha-1 is unique by having some nonce as part of it? I guess if you only work with rebases instead of merges, it should b
by algesten 10y ago
Why doesn't git upon commit ensure the sha-1 is unique by having some nonce as part of it?
I guess if you only work with rebases instead of merges, it should be possible, right?
- nhaehnle 10y agoIt would defeat the purpose of a content-addressable storage system. The fact that the same file and the same tree will always have the same hash is important for speeding up diffs, merges, and other operations.
- Manishearth 10y agoI think the answer is "it doesn't need to", because the probability of a collision is too low. The issue is with collisions in the truncated hashes which are often used to refer to objects in emails and such. Not the full SHA.