I have a broken tree with the hash given by
$ git fsck Checking object directories: 100% (256/256), done. warning in tree <tree-hash>: nullSha1: contains entries pointing to null sha1 and I want to find the commit that introduced it. I know I can find that info if I try to filter the branch with, e.g.:
$ git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <my_broken_subdir>' --prune-empty --tag-name-filter cat -- --all ... Rewrite <commit_hash> error: cache entry has null sha1: <my_broken_subdir> However, I have a long history project and running git-filter would take too long.
UPDATE
Actually, the tree is broken by that it contains a null sha1. Therefore, git bisect won't work, since in any commit I check out, running
git fsck would always give me the
warning in tree <tree-hash>: nullSha1: contains entries pointing to null sha1
git bisect? That'd at least get you to log N commits to check. Somebody more clever than I could probably give you a useful example.