lfit / itpol

Useful IT policies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git Commit Hashes

whxvd opened this issue · comments

protecting-code-integrity.md says that a Git commit hash is done over "the checksum hash of the tree before the change (parent)" (and the other fields).

But as far as I see, a commit object (see e.g. the output of git cat-file commit HEAD) contains not the hash of the tree of the parent commit but the hash of the parent commit itself. After some web search I am quite sure, that the commit hash, too, is produced using the hash of the parent commit and not the hash of the tree of the parent commit.

So, most probably, the phrase should be changed into "the checksum hash of the parent commit".