How is the Git hash calculated?
As described in “How is git commit sha1 formed “, the formula is: (printf “<type> %s\0” $(git cat-file <type> <ref> | wc -c); git cat-file <type> <ref>)|sha1sum In the case of the commit 9eabf5b536662000f79978c4d1b6e4eff5c8d785 (which is v2.4.2^{}, and which referenced a tree) : (printf “commit %s\0” $(git cat-file commit 9eabf5b536662000f79978c4d1b6e4eff5c8d785 | wc -c); git cat-file … Read more