CommitService: implement ListCommits
This is a new method in Gitaly protocol 14.2. Quoting:
// ListCommits lists all commits reachable via a set of references by doing a
// graph walk. This deprecates ListNewCommits, FindAllCommits, FindCommits
// (except Follow is not yet supported) and CommitsBetweenRequest. Any
// unknown revisions will cause the RPC to fail.
It is necessary for hgitaly_repository_spec
to pass on GitLab 14.2, and is called according to the between_uses_list_commits
feature flag, which seems to be activated by default in HDK and CI, but not in production.
From GitLab::Git::Commit
:
wrapped_gitaly_errors do
if Feature.enabled?(:between_uses_list_commits, default_enabled: :yaml)
revisions = [head, "^#{base}"] # base..head
repo.gitaly_commit_client.list_commits(revisions, reverse: true)
else
repo.gitaly_commit_client.between(base, head)
end
end
end
This examples indicates that smart translation in revset at the level of genericity of ListCommits
is a potential source of problems.