Whatever happened to SHA-256 support in Git?
Whatever happened to SHA-256 support in Git?
Posted Jun 23, 2022 20:26 UTC (Thu) by wtarreau (subscriber, #51152)In reply to: Whatever happened to SHA-256 support in Git? by bluss
Parent article: Whatever happened to SHA-256 support in Git?
There's no problem with that at all, not more than there is any with abbreviated commits nowadays. Git would just need to try to resolve an abbreviated commit to both SHA1 and SHA2 and complain in case of multiple matches. Then for the 40-char ones (SHA1) it would just have to do the same. In practice you won't design SHA2 hashes that purposely commit with SHA1, and the probability that it happens by accident is as low as having two identical SHA1 commits by accident, i.e. so close to zero that it practically is for our entire civilization.
