Skip to content

Use a sparse checkout for rebase operations

Problem to solve

Git worktree operations (like rebasing) are slow because we checkout everything. @chriscool pointed out a full checkout is not required, and a sparse checkout could be used.

From the git worktree docs:

core.sparseCheckout is recommended per working tree, unless you are sure you always use sparse checkout for all working trees.

This config option might be set at run time, using a -c flag.

Further details

We can observe on GitLab.com that the p95 and p99 timing of UserRebaseConfirmable frequently exceeds 10 seconds, and regularly approaches a minute.

Charts

link

clip-20191107T113848

link

clip-20191107T114253

Proposal

Reimplement UserRebaseConfirmable using Go (it is currently inside gitaly-ruby) using sparse-checkout

Links / references

Edited by James Ramsay (ex-GitLab)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information