Count the commits directly
What does this MR do?
Count the commits directly, instead of loading commits and count on them
Are there points in the code the reviewer needs to double check?
Not sure if this would break anything? Would this give the same results?
Why was this MR needed?
This should run way faster. Also, count_commits
is using git rev-list --count
underneath, and it could also take --left-right
so that it could count for both ahead count and behind count at the same time.
This would not solve n+1 (https://gitlab.com/gitlab-org/gitlab-ce/issues/40622) but it could half the requests.
Currently Gitaly doesn't take --left-right
though, so we'll need to add it to Gitaly.
Does this MR meet the acceptance criteria?
-
Tests added for this feature/bug - Review
-
Has been reviewed by Backend
-
What are the relevant issue numbers?
This is a step for https://gitlab.com/gitlab-org/gitlab-ce/issues/40622