build git trees using ContentIdentifier to speed up import
authorJoey Hess <joeyh@joeyh.name>
Wed, 31 May 2023 16:31:14 +0000 (12:31 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 31 May 2023 16:46:54 +0000 (12:46 -0400)
commit72981235204b5065676880be42cf64079efae881
tree28ffaf1113ec20d953105a0b09855c4bf275aba4
parent51319f85589f8ea19747cc5f45e9009079aeac1d
build git trees using ContentIdentifier to speed up import

This gets the trees built, but it does not use them. Next step will be
to remember the tree for next time an import is done, and diff between
old and new trees to find the files that have changed.

Added --missing to the mktree parameters. That only disables a check, so
it's ok to do everywhere mktree is used. It probably also speeds up
mktree to disable the check.

Note that git fsck does not complain about the resulting tree objects
that point to shas that are not in the repository. Even with --strict.

A quick benchmark, importing 10000 files, this slowed it down
from 2:04.06 to 2:04.28. So it will more than pay for itself.

Sponsored-by: Luke Shumaker on Patreon
Annex/Import.hs
Git/Tree.hs
Utility/Hash.hs