After updating Gitlab to version 7 when creating a merge request, we get a list of commits that is much larger than expected. It is providing a list of 1000+ commits when there should be 5.
Going through the source code, I am unable to find where it is that Gitlab is determining which commits to use for the merge request in order to debug that. I found the following in compare_service.rb
but am at a loss as to where to go from here.
# Compare 2 branches for one repo or between repositories
# and return Gitlab::CompareResult object that responds to commits and diffs
class CompareService
def execute(current_user, source_project, source_branch, target_project, target_branch)
# Try to compare branches to get commits list and diffs
#
# Note: Use satellite only when need to compare between two repos
# because satellites are slower than operations on bare repo
if target_project == source_project
Gitlab::CompareResult.new(
Gitlab::Git::Compare.new(
target_project.repository.raw_repository,
target_branch,
source_branch,
)
)
else
Gitlab::Satellite::CompareAction.new(
current_user,
target_project,
target_branch,
source_project,
source_branch
).result
end
end
end
Where is Gitlab getting the SHA's of the commits that are not merged into the target branch?
Gitlab::Git::Compare.new
doesn't make any sense to me. – SchleisGitlab::Git
(which is very confusing IMHO, since it's a Gitlab module outside of gitlab...). github.com/gitlabhq/gitlab_git – Ciro Santilli 新疆再教育营六四事件法轮功郝海东