How hash is calculated for commit vs tree vs blobs?

Viewed 1381

I am confused as to how SHA-1 hashes are calculated for commits, trees, and blobs. As per this article, commit hashes are calculated based on following factors:

  1. The source tree of the commit (which unravels to all the subtrees and blobs)
  2. The parent commit sha1
  3. The author info
  4. The committer info (right, those are different!)
  5. The commit message

Are the same factors involved for tree and blob hashes as well?

2 Answers
Related