4 ms·
i wonder how git would break in the face of an actual sha-1 collision...
by a-dub 5y ago
i wonder how git would break in the face of an actual sha-1 collision...
- usr1106 5y agoThe second file is just not stored, because git thinks it's already there. Nothing complicated there. Discussed here: https://stackoverflow.com/questions/9392365/how-would-git-handle-a-sha-1-collision-on-a-blob https://stackoverflow.com/questions/9392365/how-would-git-ha... It costed 6500 CPU years to create the first collision containing a valid pdf document. Storing both versions into git still works, because git prepends a header before creating the SHA-1 of the blob. I believe because of that it is harder to create a git blob collision than a pdf collision. (I admit I did neither read very carefully nor try to think it through very seriously.)
- swiftcoder 5y agoOn the other hand, if you are still running subversion, you pretty much lose the repo in this case: https://arstechnica.com/information-technology/2017/02/watershed-sha1-collision-just-broke-the-webkit-repository-others-may-follow/ https://arstechnica.com/information-technology/2017/02/water...
- COMMENT___ 5y agoThis was fixed years ago.
- swiftcoder 5y agoWhere (years <= 4), sure. 2017 is not exactly ancient history.