3 ms·
Note that collisions in short hash are not actually a problem as such. > Git can figure out a short, unique abbreviation for your SHA-1 values. If you pass --a
by codetrotter 5y ago
Note that collisions in short hash are not actually a problem as such.
> Git can figure out a short, unique abbreviation for your SHA-1 values. If you pass --abbrev-commit to the git log command, the output will use shorter values but keep them unique; it defaults to using seven characters but makes them longer if necessary to keep the SHA-1 unambiguous
https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
and also
> Git doesn't really truncate anything, internally everything will be handled with the complete value.
https://stackoverflow.com/questions/7128444/how-does-github-handle-possible-collisions-from-short-shas https://stackoverflow.com/questions/7128444/how-does-github-...
- IgorPartola 5y agoI wonder how many tools out there hard code the 7 character length for a hit commit hash length and would break upon a collision.