更新到版本7后创建的Gitlab合并请求的提交次数远远超过其应有的数量
在创建合并请求时将Gitlab更新到版本7之后,我们得到了一个比预期大得多的提交列表。它提供了1000多个提交的列表,而实际上应该有5个提交 浏览源代码时,我找不到Gitlab在哪里决定使用哪个提交来调试合并请求。我在compare_service.rb中发现了以下内容,但不知从何处着手更新到版本7后创建的Gitlab合并请求的提交次数远远超过其应有的数量,gitlab,Gitlab,在创建合并请求时将Gitlab更新到版本7之后,我们得到了一个比预期大得多的提交列表。它提供了1000多个提交的列表,而实际上应该有5个提交 浏览源代码时,我找不到Gitlab在哪里决定使用哪个提交来调试合并请求。我在compare_service.rb中发现了以下内容,但不知从何处着手 # Compare 2 branches for one repo or between repositories # and return Gitlab::CompareResult object that
# 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
Gitlab从何处获取未合并到目标分支的提交的SHA?这是Racking 0.21.0中的一个问题。希望这将很快在官方回购中更新,但您可以通过编辑/home/git/gitlab/Gemfile.lock并搜索坚固的lib来自行修复。将版本从0.21.0更新到0.21.2 之后运行捆绑包安装:
# MySQL installations (note: the line below states '--without ... postgres')
sudo -u git -H bundle install --without development test postgres --deployment
# PostgreSQL installations (note: the line below states '--without ... mysql')
sudo -u git -H bundle install --without development test mysql --deployment
Gitlab从哪里获得未合并到目标分支的提交的SHA?来源分支机构/回购和目标分支机构/回购?您必须查看这些来自何处。@CiroSantilli我知道这些来自何处,但我无法找到检查Repo以获取提交列表的实际代码。Gitlab::Git::Compare.new对我来说没有任何意义。也许你知道这一点,但如果不知道的话,它可能会有所帮助:现在,Gitlab有两个后端:砂砾分叉,正在迁移到崎岖不平的环境。为了帮助迁移,它使用gitlab_git gem作为两者的前端,它实现了gitlab::git,这让IMHO非常困惑,因为它是gitlab之外的gitlab模块@CiroSantilli谢谢你,那是我丢失的一块。我不知道那颗宝石,也不知道该怎么看。