git-sizer: Error: panic: commit is not available

When trying out git-sizer on an internal repo I am getting following error:

Processing blobs: 424652
Processing trees: 407283
panic: commit is not available

goroutine 1 [running]:
github.com/github/git-sizer/sizes.(*Graph).GetCommitSize(0xc420001380, 0xc37d1f0ae042c3b1, 0x181a181366861aad, 0xd4440d70, 0xb300000010)
	/home/mhagger/github/proj/git-sizer/git/.gopath/src/github.com/github/git-sizer/sizes/graph.go:630 +0xc6
github.com/github/git-sizer/sizes.(*Graph).RegisterCommit(0xc420001380, 0x775ac44301b3a032, 0x39b7ad7765e2bb53, 0xc4e6d0cfba, 0xc421f50180)
	/home/mhagger/github/proj/git-sizer/git/.gopath/src/github.com/github/git-sizer/sizes/graph.go:656 +0x1e1
github.com/github/git-sizer/sizes.ScanRepositoryUsingGraph(0xc42000e5d0, 0x116c6f0, 0x2, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/mhagger/github/proj/git-sizer/git/.gopath/src/github.com/github/git-sizer/sizes/graph.go:281 +0x11e8
main.mainImplementation(0x0, 0x0)
	/home/mhagger/github/proj/git-sizer/git/.gopath/src/github.com/github/git-sizer/git-sizer.go:150 +0x8ef
main.main()
	/home/mhagger/github/proj/git-sizer/git/.gopath/src/github.com/github/git-sizer/git-sizer.go:46 +0x26

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (16 by maintainers)

Most upvoted comments

Does GIT_GRAFT_FILE=NUL also work?

Yes, it does work, too!

After I running git filter-branch -f --prune-empty -- --all on my repo git sizer was happy.

@larsxschneider: presumably your repository had replace references or grafts, and the reason that git filter-branch fixed the problem is that it “baked them into” the actual repository structure. I doubt that the --prune-empty option was actually necessary.