Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-06-28 13:46:37 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-07-02 11:08:34 +0300
commita14bbcd6d026ba09d9277e49c7b380d95fe2fbbe (patch)
tree045f8e5e2c74b81e471960cad3628424d5e1b787 /ruby
parentac36efc9a611ec8e1cc9f6dcf72b84c96f120459 (diff)
commit: Implement new `ListCommits()` RPC
Implement a new `ListCommits()` RPC. In contrast to the existing RPCs, this one accepts a set of revisions including the pseudo-revisions "--not" and "--all". This design is much more flexible compared to the currently existing RPCs and is thus slated to deprecate a bunch of them. Changelog: added
Diffstat (limited to 'ruby')
-rw-r--r--ruby/proto/gitaly/commit_pb.rb23
-rw-r--r--ruby/proto/gitaly/commit_services_pb.rb5
2 files changed, 28 insertions, 0 deletions
diff --git a/ruby/proto/gitaly/commit_pb.rb b/ruby/proto/gitaly/commit_pb.rb
index 63251e66e..dfab99097 100644
--- a/ruby/proto/gitaly/commit_pb.rb
+++ b/ruby/proto/gitaly/commit_pb.rb
@@ -8,6 +8,26 @@ require 'shared_pb'
require 'google/protobuf/timestamp_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("commit.proto", :syntax => :proto3) do
+ add_message "gitaly.ListCommitsRequest" do
+ optional :repository, :message, 1, "gitaly.Repository"
+ repeated :revisions, :string, 2
+ optional :pagination_params, :message, 3, "gitaly.PaginationParameter"
+ optional :order, :enum, 4, "gitaly.ListCommitsRequest.Order"
+ optional :max_parents, :uint32, 5
+ optional :disable_walk, :bool, 6
+ optional :first_parent, :bool, 7
+ optional :after, :message, 8, "google.protobuf.Timestamp"
+ optional :before, :message, 9, "google.protobuf.Timestamp"
+ optional :author, :bytes, 10
+ end
+ add_enum "gitaly.ListCommitsRequest.Order" do
+ value :NONE, 0
+ value :TOPO, 1
+ value :DATE, 2
+ end
+ add_message "gitaly.ListCommitsResponse" do
+ repeated :commits, :message, 1, "gitaly.GitCommit"
+ end
add_message "gitaly.CommitStatsRequest" do
optional :repository, :message, 1, "gitaly.Repository"
optional :revision, :bytes, 2
@@ -270,6 +290,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
end
module Gitaly
+ ListCommitsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ListCommitsRequest").msgclass
+ ListCommitsRequest::Order = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ListCommitsRequest.Order").enummodule
+ ListCommitsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ListCommitsResponse").msgclass
CommitStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitStatsRequest").msgclass
CommitStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitStatsResponse").msgclass
CommitIsAncestorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitIsAncestorRequest").msgclass
diff --git a/ruby/proto/gitaly/commit_services_pb.rb b/ruby/proto/gitaly/commit_services_pb.rb
index 4f761c423..77bb22134 100644
--- a/ruby/proto/gitaly/commit_services_pb.rb
+++ b/ruby/proto/gitaly/commit_services_pb.rb
@@ -14,6 +14,11 @@ module Gitaly
self.unmarshal_class_method = :decode
self.service_name = 'gitaly.CommitService'
+ # 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.
+ rpc :ListCommits, Gitaly::ListCommitsRequest, stream(Gitaly::ListCommitsResponse)
rpc :CommitIsAncestor, Gitaly::CommitIsAncestorRequest, Gitaly::CommitIsAncestorResponse
rpc :TreeEntry, Gitaly::TreeEntryRequest, stream(Gitaly::TreeEntryResponse)
rpc :CommitsBetween, Gitaly::CommitsBetweenRequest, stream(Gitaly::CommitsBetweenResponse)