git - apparently same commits give different sha1, why? -
after re-write of subtree history repository script of mine, compared git filter-branch ... on same subtree. see initial commits have different sha1 although expected them identical (consequence of commits both histories have different sha1).
doing git show --format=raw <commit-sha1> on both commits gives same output (except first line, commit <commit-sha1>, introducing result).
object files different, binaries, can't figure out root cause.
assuming git versions consistent each other, explain have 2 different sha1?
thank you
git's inputs commit hash include metadata such sha1 of tree, sha1 of parent, commiter's name, email , commit date, , author's name, email , commit date. when rewrote history, commiter commit date , tree (since did filter-branch) have changed, hence difference in commit's sha1.
for more information format of commit, can use git cat-file commit <sha>, or git objects section of git book.
Comments
Post a Comment