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
diff options
context:
space:
mode:
-rw-r--r--internal/gitaly/service/blob/lfs_pointers.go32
-rw-r--r--internal/gitaly/service/blob/lfs_pointers_test.go110
-rw-r--r--proto/blob.proto39
-rw-r--r--proto/go/gitalypb/blob.pb.go286
-rw-r--r--ruby/proto/gitaly/blob_pb.rb10
-rw-r--r--ruby/proto/gitaly/blob_services_pb.rb15
6 files changed, 448 insertions, 44 deletions
diff --git a/internal/gitaly/service/blob/lfs_pointers.go b/internal/gitaly/service/blob/lfs_pointers.go
index f30594e1b..329fff832 100644
--- a/internal/gitaly/service/blob/lfs_pointers.go
+++ b/internal/gitaly/service/blob/lfs_pointers.go
@@ -39,6 +39,38 @@ type getLFSPointerByRevisionRequest interface {
GetRevision() []byte
}
+// ListLFSPointers finds all LFS pointers which are transitively reachable via a graph walk of the
+// given set of revisions.
+func (s *server) ListLFSPointers(in *gitalypb.ListLFSPointersRequest, stream gitalypb.BlobService_ListLFSPointersServer) error {
+ ctx := stream.Context()
+
+ if in.GetRepository() == nil {
+ return status.Error(codes.InvalidArgument, "empty repository")
+ }
+ if len(in.Revisions) == 0 {
+ return status.Error(codes.InvalidArgument, "missing revisions")
+ }
+
+ repo := localrepo.New(s.gitCmdFactory, in.Repository, s.cfg)
+ lfsPointers, err := findLFSPointersByRevisions(ctx, repo, s.gitCmdFactory, int(in.Limit), in.Revisions...)
+ if err != nil {
+ if errors.Is(err, errInvalidRevision) {
+ return status.Errorf(codes.InvalidArgument, err.Error())
+ }
+ return err
+ }
+
+ if err := sliceLFSPointers(lfsPointers, func(slice []*gitalypb.LFSPointer) error {
+ return stream.Send(&gitalypb.ListLFSPointersResponse{
+ LfsPointers: slice,
+ })
+ }); err != nil {
+ return err
+ }
+
+ return nil
+}
+
// GetLFSPointers takes the list of requested blob IDs and filters them down to blobs which are
// valid LFS pointers. It is fine to pass blob IDs which do not point to a valid LFS pointer, but
// passing blob IDs which do not exist results in an error.
diff --git a/internal/gitaly/service/blob/lfs_pointers_test.go b/internal/gitaly/service/blob/lfs_pointers_test.go
index c51c214b3..2e0cab071 100644
--- a/internal/gitaly/service/blob/lfs_pointers_test.go
+++ b/internal/gitaly/service/blob/lfs_pointers_test.go
@@ -19,6 +19,7 @@ import (
"gitlab.com/gitlab-org/gitaly/internal/testhelper/testcfg"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
)
const (
@@ -65,6 +66,115 @@ var (
}
)
+func TestListLFSPointers(t *testing.T) {
+ _, repo, _, client := setup(t)
+
+ ctx, cancel := testhelper.Context()
+ defer cancel()
+
+ for _, tc := range []struct {
+ desc string
+ revs []string
+ limit int32
+ expectedPointers []*gitalypb.LFSPointer
+ expectedErr error
+ }{
+ {
+ desc: "missing revisions",
+ revs: []string{},
+ expectedErr: status.Error(codes.InvalidArgument, "missing revisions"),
+ },
+ {
+ desc: "invalid revision",
+ revs: []string{"-dashed"},
+ expectedErr: status.Error(codes.InvalidArgument, "invalid revision: \"-dashed\""),
+ },
+ {
+ desc: "object IDs",
+ revs: []string{
+ lfsPointer1,
+ lfsPointer2,
+ lfsPointer3,
+ "d5b560e9c17384cf8257347db63167b54e0c97ff", // tree
+ "60ecb67744cb56576c30214ff52294f8ce2def98", // commit
+ },
+ expectedPointers: []*gitalypb.LFSPointer{
+ lfsPointers[lfsPointer1],
+ lfsPointers[lfsPointer2],
+ lfsPointers[lfsPointer3],
+ },
+ },
+ {
+ desc: "revision",
+ revs: []string{"refs/heads/master"},
+ expectedPointers: []*gitalypb.LFSPointer{
+ lfsPointers[lfsPointer1],
+ },
+ },
+ {
+ desc: "pseudo-revisions",
+ revs: []string{"refs/heads/master", "--not", "--all"},
+ },
+ {
+ desc: "partial graph walk",
+ revs: []string{"--all", "--not", "refs/heads/master"},
+ expectedPointers: []*gitalypb.LFSPointer{
+ lfsPointers[lfsPointer2],
+ lfsPointers[lfsPointer3],
+ lfsPointers[lfsPointer4],
+ lfsPointers[lfsPointer5],
+ lfsPointers[lfsPointer6],
+ },
+ },
+ {
+ desc: "partial graph walk with matching limit",
+ revs: []string{"--all", "--not", "refs/heads/master"},
+ limit: 5,
+ expectedPointers: []*gitalypb.LFSPointer{
+ lfsPointers[lfsPointer2],
+ lfsPointers[lfsPointer3],
+ lfsPointers[lfsPointer4],
+ lfsPointers[lfsPointer5],
+ lfsPointers[lfsPointer6],
+ },
+ },
+ {
+ desc: "partial graph walk with limiting limit",
+ revs: []string{"--all", "--not", "refs/heads/master"},
+ limit: 3,
+ expectedPointers: []*gitalypb.LFSPointer{
+ lfsPointers[lfsPointer4],
+ lfsPointers[lfsPointer5],
+ lfsPointers[lfsPointer6],
+ },
+ },
+ } {
+ t.Run(tc.desc, func(t *testing.T) {
+ stream, err := client.ListLFSPointers(ctx, &gitalypb.ListLFSPointersRequest{
+ Repository: repo,
+ Revisions: tc.revs,
+ Limit: tc.limit,
+ })
+ require.NoError(t, err)
+
+ var actualLFSPointers []*gitalypb.LFSPointer
+ for {
+ resp, err := stream.Recv()
+ if err == io.EOF {
+ break
+ }
+ require.Equal(t, err, tc.expectedErr)
+ if err != nil {
+ break
+ }
+
+ actualLFSPointers = append(actualLFSPointers, resp.GetLfsPointers()...)
+ }
+ require.ElementsMatch(t, tc.expectedPointers, actualLFSPointers)
+ })
+ }
+}
+
func TestSuccessfulGetLFSPointersRequest(t *testing.T) {
testhelper.NewFeatureSets([]featureflag.FeatureFlag{
featureflag.LFSPointersUseBitmapIndex,
diff --git a/proto/blob.proto b/proto/blob.proto
index 5798a04fe..db7eda834 100644
--- a/proto/blob.proto
+++ b/proto/blob.proto
@@ -25,6 +25,8 @@ service BlobService {
// GetLFSPointers retrieves LFS pointers from a given set of object IDs.
// This RPC filters all requested objects and only returns those which refer
// to a valid LFS pointer.
+ //
+ // Deprecated in favor of `ListLFSPointers`, passing object IDs as revisions.
rpc GetLFSPointers(GetLFSPointersRequest) returns (stream GetLFSPointersResponse) {
option (op_type) = {
op: ACCESSOR
@@ -34,6 +36,10 @@ service BlobService {
// GetNewLFSPointers retrieves LFS pointers for a limited subset of the
// commit graph. It will return all LFS pointers which are reachable by the
// provided revision, but not reachable by any of the limiting references.
+ //
+ // Deprecated in favor of `ListLFSPointers`. `NotInAll` can be replaced with
+ // `REVISION` `--not` `--all`, while `NotInRefs` can be replaced with
+ // `REVISION` `--not` `NotInRevs...`.
rpc GetNewLFSPointers(GetNewLFSPointersRequest) returns (stream GetNewLFSPointersResponse) {
option (op_type) = {
op: ACCESSOR
@@ -41,11 +47,26 @@ service BlobService {
}
// GetAllLFSPointers retrieves all LFS pointers of the given repository.
+ //
+ // Deprecated in favor of `ListLFSPointers`, passing `--all` as revision.
rpc GetAllLFSPointers(GetAllLFSPointersRequest) returns (stream GetAllLFSPointersResponse) {
option (op_type) = {
op: ACCESSOR
};
}
+
+ // ListLFSPointers retrieves LFS pointers reachable from a given set of
+ // revisions by doing a graph walk. This includes both normal revisions like
+ // an object ID or branch, but also the pseudo-revisions "--all" and "--not"
+ // as documented in git-rev-parse(1). Revisions which don't directly or
+ // transitively reference any LFS pointers are ignored. It is not valid to
+ // pass revisions which do not resolve to an existing object.
+ rpc ListLFSPointers(ListLFSPointersRequest) returns (stream ListLFSPointersResponse) {
+ option (op_type) = {
+ op: ACCESSOR
+ };
+ }
+
}
message GetBlobRequest {
@@ -166,3 +187,21 @@ message GetAllLFSPointersResponse {
// LfsPointers is the list of LFS pointers.
repeated LFSPointer lfs_pointers = 1;
}
+
+// ListLFSPointersRequest is a request for the ListLFSPointers RPC.
+message ListLFSPointersRequest {
+ // Repository is the repository for which LFS pointers should be retrieved
+ // from.
+ Repository repository = 1[(target_repository)=true];
+ // Revisions is the list of revisions to retrieve LFS pointers from. Must be
+ // a non-empty list.
+ repeated string revisions = 2;
+ // Limit limits the number of LFS pointers returned.
+ int32 limit = 3;
+}
+
+// ListLFSPointersResponse is a response for the ListLFSPointers RPC.
+message ListLFSPointersResponse {
+ // LfsPointers is the list of LFS pointers which were requested.
+ repeated LFSPointer lfs_pointers = 1;
+}
diff --git a/proto/go/gitalypb/blob.pb.go b/proto/go/gitalypb/blob.pb.go
index b75143edb..cd5c554a7 100644
--- a/proto/go/gitalypb/blob.pb.go
+++ b/proto/go/gitalypb/blob.pb.go
@@ -756,6 +756,108 @@ func (m *GetAllLFSPointersResponse) GetLfsPointers() []*LFSPointer {
return nil
}
+// ListLFSPointersRequest is a request for the ListLFSPointers RPC.
+type ListLFSPointersRequest struct {
+ // Repository is the repository for which LFS pointers should be retrieved
+ // from.
+ Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
+ // Revisions is the list of revisions to retrieve LFS pointers from. Must be
+ // a non-empty list.
+ Revisions []string `protobuf:"bytes,2,rep,name=revisions,proto3" json:"revisions,omitempty"`
+ // Limit limits the number of LFS pointers returned.
+ Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ListLFSPointersRequest) Reset() { *m = ListLFSPointersRequest{} }
+func (m *ListLFSPointersRequest) String() string { return proto.CompactTextString(m) }
+func (*ListLFSPointersRequest) ProtoMessage() {}
+func (*ListLFSPointersRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_6903d1e8a20272e8, []int{12}
+}
+
+func (m *ListLFSPointersRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ListLFSPointersRequest.Unmarshal(m, b)
+}
+func (m *ListLFSPointersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ListLFSPointersRequest.Marshal(b, m, deterministic)
+}
+func (m *ListLFSPointersRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ListLFSPointersRequest.Merge(m, src)
+}
+func (m *ListLFSPointersRequest) XXX_Size() int {
+ return xxx_messageInfo_ListLFSPointersRequest.Size(m)
+}
+func (m *ListLFSPointersRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_ListLFSPointersRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ListLFSPointersRequest proto.InternalMessageInfo
+
+func (m *ListLFSPointersRequest) GetRepository() *Repository {
+ if m != nil {
+ return m.Repository
+ }
+ return nil
+}
+
+func (m *ListLFSPointersRequest) GetRevisions() []string {
+ if m != nil {
+ return m.Revisions
+ }
+ return nil
+}
+
+func (m *ListLFSPointersRequest) GetLimit() int32 {
+ if m != nil {
+ return m.Limit
+ }
+ return 0
+}
+
+// ListLFSPointersResponse is a response for the ListLFSPointers RPC.
+type ListLFSPointersResponse struct {
+ // LfsPointers is the list of LFS pointers which were requested.
+ LfsPointers []*LFSPointer `protobuf:"bytes,1,rep,name=lfs_pointers,json=lfsPointers,proto3" json:"lfs_pointers,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ListLFSPointersResponse) Reset() { *m = ListLFSPointersResponse{} }
+func (m *ListLFSPointersResponse) String() string { return proto.CompactTextString(m) }
+func (*ListLFSPointersResponse) ProtoMessage() {}
+func (*ListLFSPointersResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_6903d1e8a20272e8, []int{13}
+}
+
+func (m *ListLFSPointersResponse) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ListLFSPointersResponse.Unmarshal(m, b)
+}
+func (m *ListLFSPointersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ListLFSPointersResponse.Marshal(b, m, deterministic)
+}
+func (m *ListLFSPointersResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ListLFSPointersResponse.Merge(m, src)
+}
+func (m *ListLFSPointersResponse) XXX_Size() int {
+ return xxx_messageInfo_ListLFSPointersResponse.Size(m)
+}
+func (m *ListLFSPointersResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_ListLFSPointersResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ListLFSPointersResponse proto.InternalMessageInfo
+
+func (m *ListLFSPointersResponse) GetLfsPointers() []*LFSPointer {
+ if m != nil {
+ return m.LfsPointers
+ }
+ return nil
+}
+
func init() {
proto.RegisterType((*GetBlobRequest)(nil), "gitaly.GetBlobRequest")
proto.RegisterType((*GetBlobResponse)(nil), "gitaly.GetBlobResponse")
@@ -770,55 +872,60 @@ func init() {
proto.RegisterType((*GetNewLFSPointersResponse)(nil), "gitaly.GetNewLFSPointersResponse")
proto.RegisterType((*GetAllLFSPointersRequest)(nil), "gitaly.GetAllLFSPointersRequest")
proto.RegisterType((*GetAllLFSPointersResponse)(nil), "gitaly.GetAllLFSPointersResponse")
+ proto.RegisterType((*ListLFSPointersRequest)(nil), "gitaly.ListLFSPointersRequest")
+ proto.RegisterType((*ListLFSPointersResponse)(nil), "gitaly.ListLFSPointersResponse")
}
func init() { proto.RegisterFile("blob.proto", fileDescriptor_6903d1e8a20272e8) }
var fileDescriptor_6903d1e8a20272e8 = []byte{
- // 676 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xc1, 0x6e, 0xd3, 0x40,
- 0x10, 0x95, 0xe3, 0x24, 0x75, 0x26, 0x69, 0x29, 0x2b, 0x68, 0x5d, 0x0b, 0x2a, 0xd7, 0x42, 0xc8,
- 0x07, 0x48, 0xaa, 0x22, 0x24, 0x4e, 0x48, 0xad, 0x50, 0xa3, 0x52, 0xd4, 0x56, 0x5b, 0x2e, 0xf4,
- 0x12, 0xd9, 0xf5, 0xa6, 0x5d, 0xb4, 0xf1, 0x1a, 0xef, 0xb6, 0x55, 0xf8, 0x11, 0xf8, 0x1b, 0x2e,
- 0x88, 0x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 0x37, 0xd7, 0xd8, 0xf9, 0xcf, 0x17, 0x33, 0x30, 0x26, 0xc5, 0x38, 0x81, 0x51, 0x7a, 0x07, 0x26,
+ 0x30, 0xca, 0x95, 0x9c, 0xc3, 0xf8, 0x08, 0xab, 0x53, 0x9a, 0x40, 0xe3, 0x21, 0x94, 0x8b, 0xd6,
+ 0x78, 0x32, 0x33, 0x3e, 0x5d, 0xfd, 0x60, 0xf7, 0x32, 0xfc, 0x96, 0x39, 0x6e, 0xfb, 0x8a, 0x0f,
+ 0x3b, 0xf1, 0xf1, 0x05, 0x0f, 0xae, 0x3b, 0x71, 0x85, 0x4e, 0xf4, 0x6f, 0xa6, 0x73, 0xcd, 0x13,
+ 0xdb, 0x77, 0xdd, 0x7a, 0xe4, 0x7a, 0xf9, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xab, 0x7a, 0x42, 0x65,
+ 0x10, 0x09, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -841,13 +948,28 @@ type BlobServiceClient interface {
// GetLFSPointers retrieves LFS pointers from a given set of object IDs.
// This RPC filters all requested objects and only returns those which refer
// to a valid LFS pointer.
+ //
+ // Deprecated in favor of `ListLFSPointers`, passing object IDs as revisions.
GetLFSPointers(ctx context.Context, in *GetLFSPointersRequest, opts ...grpc.CallOption) (BlobService_GetLFSPointersClient, error)
// GetNewLFSPointers retrieves LFS pointers for a limited subset of the
// commit graph. It will return all LFS pointers which are reachable by the
// provided revision, but not reachable by any of the limiting references.
+ //
+ // Deprecated in favor of `ListLFSPointers`. `NotInAll` can be replaced with
+ // `REVISION` `--not` `--all`, while `NotInRefs` can be replaced with
+ // `REVISION` `--not` `NotInRevs...`.
GetNewLFSPointers(ctx context.Context, in *GetNewLFSPointersRequest, opts ...grpc.CallOption) (BlobService_GetNewLFSPointersClient, error)
// GetAllLFSPointers retrieves all LFS pointers of the given repository.
+ //
+ // Deprecated in favor of `ListLFSPointers`, passing `--all` as revision.
GetAllLFSPointers(ctx context.Context, in *GetAllLFSPointersRequest, opts ...grpc.CallOption) (BlobService_GetAllLFSPointersClient, error)
+ // ListLFSPointers retrieves LFS pointers reachable from a given set of
+ // revisions by doing a graph walk. This includes both normal revisions like
+ // an object ID or branch, but also the pseudo-revisions "--all" and "--not"
+ // as documented in git-rev-parse(1). Revisions which don't directly or
+ // transitively reference any LFS pointers are ignored. It is not valid to
+ // pass revisions which do not resolve to an existing object.
+ ListLFSPointers(ctx context.Context, in *ListLFSPointersRequest, opts ...grpc.CallOption) (BlobService_ListLFSPointersClient, error)
}
type blobServiceClient struct {
@@ -1018,6 +1140,38 @@ func (x *blobServiceGetAllLFSPointersClient) Recv() (*GetAllLFSPointersResponse,
return m, nil
}
+func (c *blobServiceClient) ListLFSPointers(ctx context.Context, in *ListLFSPointersRequest, opts ...grpc.CallOption) (BlobService_ListLFSPointersClient, error) {
+ stream, err := c.cc.NewStream(ctx, &_BlobService_serviceDesc.Streams[5], "/gitaly.BlobService/ListLFSPointers", opts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &blobServiceListLFSPointersClient{stream}
+ if err := x.ClientStream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err := x.ClientStream.CloseSend(); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type BlobService_ListLFSPointersClient interface {
+ Recv() (*ListLFSPointersResponse, error)
+ grpc.ClientStream
+}
+
+type blobServiceListLFSPointersClient struct {
+ grpc.ClientStream
+}
+
+func (x *blobServiceListLFSPointersClient) Recv() (*ListLFSPointersResponse, error) {
+ m := new(ListLFSPointersResponse)
+ if err := x.ClientStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
// BlobServiceServer is the server API for BlobService service.
type BlobServiceServer interface {
// GetBlob returns the contents of a blob object referenced by its object
@@ -1028,13 +1182,28 @@ type BlobServiceServer interface {
// GetLFSPointers retrieves LFS pointers from a given set of object IDs.
// This RPC filters all requested objects and only returns those which refer
// to a valid LFS pointer.
+ //
+ // Deprecated in favor of `ListLFSPointers`, passing object IDs as revisions.
GetLFSPointers(*GetLFSPointersRequest, BlobService_GetLFSPointersServer) error
// GetNewLFSPointers retrieves LFS pointers for a limited subset of the
// commit graph. It will return all LFS pointers which are reachable by the
// provided revision, but not reachable by any of the limiting references.
+ //
+ // Deprecated in favor of `ListLFSPointers`. `NotInAll` can be replaced with
+ // `REVISION` `--not` `--all`, while `NotInRefs` can be replaced with
+ // `REVISION` `--not` `NotInRevs...`.
GetNewLFSPointers(*GetNewLFSPointersRequest, BlobService_GetNewLFSPointersServer) error
// GetAllLFSPointers retrieves all LFS pointers of the given repository.
+ //
+ // Deprecated in favor of `ListLFSPointers`, passing `--all` as revision.
GetAllLFSPointers(*GetAllLFSPointersRequest, BlobService_GetAllLFSPointersServer) error
+ // ListLFSPointers retrieves LFS pointers reachable from a given set of
+ // revisions by doing a graph walk. This includes both normal revisions like
+ // an object ID or branch, but also the pseudo-revisions "--all" and "--not"
+ // as documented in git-rev-parse(1). Revisions which don't directly or
+ // transitively reference any LFS pointers are ignored. It is not valid to
+ // pass revisions which do not resolve to an existing object.
+ ListLFSPointers(*ListLFSPointersRequest, BlobService_ListLFSPointersServer) error
}
// UnimplementedBlobServiceServer can be embedded to have forward compatible implementations.
@@ -1056,6 +1225,9 @@ func (*UnimplementedBlobServiceServer) GetNewLFSPointers(req *GetNewLFSPointersR
func (*UnimplementedBlobServiceServer) GetAllLFSPointers(req *GetAllLFSPointersRequest, srv BlobService_GetAllLFSPointersServer) error {
return status.Errorf(codes.Unimplemented, "method GetAllLFSPointers not implemented")
}
+func (*UnimplementedBlobServiceServer) ListLFSPointers(req *ListLFSPointersRequest, srv BlobService_ListLFSPointersServer) error {
+ return status.Errorf(codes.Unimplemented, "method ListLFSPointers not implemented")
+}
func RegisterBlobServiceServer(s *grpc.Server, srv BlobServiceServer) {
s.RegisterService(&_BlobService_serviceDesc, srv)
@@ -1166,6 +1338,27 @@ func (x *blobServiceGetAllLFSPointersServer) Send(m *GetAllLFSPointersResponse)
return x.ServerStream.SendMsg(m)
}
+func _BlobService_ListLFSPointers_Handler(srv interface{}, stream grpc.ServerStream) error {
+ m := new(ListLFSPointersRequest)
+ if err := stream.RecvMsg(m); err != nil {
+ return err
+ }
+ return srv.(BlobServiceServer).ListLFSPointers(m, &blobServiceListLFSPointersServer{stream})
+}
+
+type BlobService_ListLFSPointersServer interface {
+ Send(*ListLFSPointersResponse) error
+ grpc.ServerStream
+}
+
+type blobServiceListLFSPointersServer struct {
+ grpc.ServerStream
+}
+
+func (x *blobServiceListLFSPointersServer) Send(m *ListLFSPointersResponse) error {
+ return x.ServerStream.SendMsg(m)
+}
+
var _BlobService_serviceDesc = grpc.ServiceDesc{
ServiceName: "gitaly.BlobService",
HandlerType: (*BlobServiceServer)(nil),
@@ -1196,6 +1389,11 @@ var _BlobService_serviceDesc = grpc.ServiceDesc{
Handler: _BlobService_GetAllLFSPointers_Handler,
ServerStreams: true,
},
+ {
+ StreamName: "ListLFSPointers",
+ Handler: _BlobService_ListLFSPointers_Handler,
+ ServerStreams: true,
+ },
},
Metadata: "blob.proto",
}
diff --git a/ruby/proto/gitaly/blob_pb.rb b/ruby/proto/gitaly/blob_pb.rb
index 084f0facc..d950765a4 100644
--- a/ruby/proto/gitaly/blob_pb.rb
+++ b/ruby/proto/gitaly/blob_pb.rb
@@ -69,6 +69,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.GetAllLFSPointersResponse" do
repeated :lfs_pointers, :message, 1, "gitaly.LFSPointer"
end
+ add_message "gitaly.ListLFSPointersRequest" do
+ optional :repository, :message, 1, "gitaly.Repository"
+ repeated :revisions, :string, 2
+ optional :limit, :int32, 3
+ end
+ add_message "gitaly.ListLFSPointersResponse" do
+ repeated :lfs_pointers, :message, 1, "gitaly.LFSPointer"
+ end
end
end
@@ -86,4 +94,6 @@ module Gitaly
GetNewLFSPointersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.GetNewLFSPointersResponse").msgclass
GetAllLFSPointersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.GetAllLFSPointersRequest").msgclass
GetAllLFSPointersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.GetAllLFSPointersResponse").msgclass
+ ListLFSPointersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ListLFSPointersRequest").msgclass
+ ListLFSPointersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ListLFSPointersResponse").msgclass
end
diff --git a/ruby/proto/gitaly/blob_services_pb.rb b/ruby/proto/gitaly/blob_services_pb.rb
index 149e27c81..72ecd6a2e 100644
--- a/ruby/proto/gitaly/blob_services_pb.rb
+++ b/ruby/proto/gitaly/blob_services_pb.rb
@@ -22,13 +22,28 @@ module Gitaly
# GetLFSPointers retrieves LFS pointers from a given set of object IDs.
# This RPC filters all requested objects and only returns those which refer
# to a valid LFS pointer.
+ #
+ # Deprecated in favor of `ListLFSPointers`, passing object IDs as revisions.
rpc :GetLFSPointers, Gitaly::GetLFSPointersRequest, stream(Gitaly::GetLFSPointersResponse)
# GetNewLFSPointers retrieves LFS pointers for a limited subset of the
# commit graph. It will return all LFS pointers which are reachable by the
# provided revision, but not reachable by any of the limiting references.
+ #
+ # Deprecated in favor of `ListLFSPointers`. `NotInAll` can be replaced with
+ # `REVISION` `--not` `--all`, while `NotInRefs` can be replaced with
+ # `REVISION` `--not` `NotInRevs...`.
rpc :GetNewLFSPointers, Gitaly::GetNewLFSPointersRequest, stream(Gitaly::GetNewLFSPointersResponse)
# GetAllLFSPointers retrieves all LFS pointers of the given repository.
+ #
+ # Deprecated in favor of `ListLFSPointers`, passing `--all` as revision.
rpc :GetAllLFSPointers, Gitaly::GetAllLFSPointersRequest, stream(Gitaly::GetAllLFSPointersResponse)
+ # ListLFSPointers retrieves LFS pointers reachable from a given set of
+ # revisions by doing a graph walk. This includes both normal revisions like
+ # an object ID or branch, but also the pseudo-revisions "--all" and "--not"
+ # as documented in git-rev-parse(1). Revisions which don't directly or
+ # transitively reference any LFS pointers are ignored. It is not valid to
+ # pass revisions which do not resolve to an existing object.
+ rpc :ListLFSPointers, Gitaly::ListLFSPointersRequest, stream(Gitaly::ListLFSPointersResponse)
end
Stub = Service.rpc_stub_class