Substantially speed up pushing changes for review
Pushing a new change for review checks if the change is related to
the branch it's destined for. It used to do this in a way that
required a topo-sort of the rev history, and now uses JGit's
merge-base functionality.
Typically new commits for review are close to the branch head, so
a merge base can be quickly found. The ugly corner case is when
there is no history in common, JGit will walk to the root of both
branches before erroring out to the end-user. This fortunately does
not happen very frequently. If the walk to the root would be costly
on the new commits, the user typically notices the problem during
`git push` counting too many objects and aborts the request before
the code even reaches this point.
Change-Id: I2b41e6befcb1abbfdb7ca712e1d6d5e17ba74d78
Signed-Off-By: James Y Knight <jyknight@google.com>
1 file changed