Rebase operation can be extremely slow or fail
Since a recent Gitlab upgrade we have the problem that the rebase operation in merge requests takes around ten minutes in some developers' repositories while it works perfectly fast in others. I believe the issue was caused by the changes made in MR !1611 (merged), developed by @zj-gitlab.
The rebase operation makes a diff between the source and destination branches, e.g. master...my-feature-branch
, to determine the list of files for a sparse checkout. The problem is that this master
refers to the destination branch in the developer's fork, not the one in the destination repository (which isn't even fetched at this point). If the two branches have diverged the file list can be too long (making the operation slow) or too short (causing the rebase to fail).