diff --git a/internal/gitaly/service/diff/find_changed_paths.go b/internal/gitaly/service/diff/find_changed_paths.go index 01a2a4f45d601fb1d790160d3cb5465b3d91f5e7..2ff2c9c14f092d23feb48dcb1f1f74684f02dc4a 100644 --- a/internal/gitaly/service/diff/find_changed_paths.go +++ b/internal/gitaly/service/diff/find_changed_paths.go @@ -19,6 +19,40 @@ const ( numStatDelimiter = 0 ) +func (s *server) findChangedPathsCommon(ctx context.Context, name string, repository *gitalypb.Repository, options []git.Option, args []string, cmdOpts []git.CmdOpt, diffChunker *chunk.Chunker) error { + flags := append([]git.Option{ + git.Flag{Name: "-z"}, + git.Flag{Name: "-m"}, + git.Flag{Name: "-r"}, + git.Flag{Name: "--name-status"}, + git.Flag{Name: "--no-renames"}, + git.Flag{Name: "--no-commit-id"}, + git.Flag{Name: "--diff-filter=AMDTC"}, + }, options...) + + cmd, err := s.gitCmdFactory.New(ctx, repository, git.SubCmd{ + Name: "diff-tree", + Flags: flags, + Args: args, + }, cmdOpts...) + if err != nil { + if _, ok := status.FromError(err); ok { + return fmt.Errorf("%s Stdin Err: %w", name, err) + } + return status.Errorf(codes.Internal, "%s: Cmd Err: %v", name, err) + } + + if err := parsePaths(name, bufio.NewReader(cmd), diffChunker); err != nil { + return fmt.Errorf("%s Parsing Err: %w", name, err) + } + + if err := cmd.Wait(); err != nil { + return status.Errorf(codes.Unavailable, "%s: Cmd Wait Err: %v", name, err) + } + + return diffChunker.Flush() +} + func (s *server) FindChangedPaths(in *gitalypb.FindChangedPathsRequest, stream gitalypb.DiffService_FindChangedPathsServer) error { if err := s.validateFindChangedPathsRequestParams(stream.Context(), in); err != nil { return err @@ -26,40 +60,32 @@ func (s *server) FindChangedPaths(in *gitalypb.FindChangedPathsRequest, stream g diffChunker := chunk.New(&findChangedPathsSender{stream: stream}) - cmd, err := s.gitCmdFactory.New(stream.Context(), in.Repository, git.SubCmd{ - Name: "diff-tree", - Flags: []git.Option{ - git.Flag{Name: "-z"}, - git.Flag{Name: "--stdin"}, - git.Flag{Name: "-m"}, - git.Flag{Name: "-r"}, - git.Flag{Name: "--name-status"}, - git.Flag{Name: "--no-renames"}, - git.Flag{Name: "--no-commit-id"}, - git.Flag{Name: "--diff-filter=AMDTC"}, - }, - }, git.WithStdin(strings.NewReader(strings.Join(in.GetCommits(), "\n")+"\n"))) - if err != nil { - if _, ok := status.FromError(err); ok { - return fmt.Errorf("FindChangedPaths Stdin Err: %w", err) - } - return status.Errorf(codes.Internal, "FindChangedPaths: Cmd Err: %v", err) + options := []git.Option{ + git.Flag{Name: "--stdin"}, } - - if err := parsePaths(bufio.NewReader(cmd), diffChunker); err != nil { - return fmt.Errorf("FindChangedPaths Parsing Err: %w", err) + cmdOpts := []git.CmdOpt{ + git.WithStdin(strings.NewReader(strings.Join(in.GetCommits(), "\n") + "\n")), } + return s.findChangedPathsCommon(stream.Context(), "FindChangedPaths", in.GetRepository(), options, nil, cmdOpts, diffChunker) +} - if err := cmd.Wait(); err != nil { - return status.Errorf(codes.Unavailable, "FindChangedPaths: Cmd Wait Err: %v", err) +func (s *server) FindChangedPathsBetweenCommits(in *gitalypb.FindChangedPathsBetweenCommitsRequest, stream gitalypb.DiffService_FindChangedPathsBetweenCommitsServer) error { + if err := s.validateFindChangedPathsBetweenCommitsRequestParams(stream.Context(), in); err != nil { + return err } - return diffChunker.Flush() + diffChunker := chunk.New(&findChangedPathsBetweenCommitsSender{stream: stream}) + + args := []string{ + in.GetLeftCommitId(), + in.GetRightCommitId(), + } + return s.findChangedPathsCommon(stream.Context(), "FindChangedPathsBetweenCommits", in.GetRepository(), nil, args, nil, diffChunker) } -func parsePaths(reader *bufio.Reader, chunker *chunk.Chunker) error { +func parsePaths(name string, reader *bufio.Reader, chunker *chunk.Chunker) error { for { - path, err := nextPath(reader) + path, err := nextPath(name, reader) if err != nil { if err == io.EOF { break @@ -76,7 +102,7 @@ func parsePaths(reader *bufio.Reader, chunker *chunk.Chunker) error { return nil } -func nextPath(reader *bufio.Reader) (*gitalypb.ChangedPaths, error) { +func nextPath(name string, reader *bufio.Reader) (*gitalypb.ChangedPaths, error) { pathStatus, err := reader.ReadBytes(numStatDelimiter) if err != nil { return nil, err @@ -97,7 +123,7 @@ func nextPath(reader *bufio.Reader) (*gitalypb.ChangedPaths, error) { parsedPath, ok := statusTypeMap[string(pathStatus[:len(pathStatus)-1])] if !ok { - return nil, status.Errorf(codes.Internal, "FindChangedPaths: Unknown changed paths returned: %v", string(pathStatus)) + return nil, status.Errorf(codes.Internal, "%s: Unknown changed paths returned: %v", name, string(pathStatus)) } changedPath := &gitalypb.ChangedPaths{ @@ -128,17 +154,36 @@ func (t *findChangedPathsSender) Send() error { }) } -func (s *server) validateFindChangedPathsRequestParams(ctx context.Context, in *gitalypb.FindChangedPathsRequest) error { - repo := in.GetRepository() +// This sender implements the interface in the chunker class +type findChangedPathsBetweenCommitsSender struct { + paths []*gitalypb.ChangedPaths + stream gitalypb.DiffService_FindChangedPathsBetweenCommitsServer +} + +func (t *findChangedPathsBetweenCommitsSender) Reset() { + t.paths = nil +} + +func (t *findChangedPathsBetweenCommitsSender) Append(m proto.Message) { + t.paths = append(t.paths, m.(*gitalypb.ChangedPaths)) +} + +func (t *findChangedPathsBetweenCommitsSender) Send() error { + return t.stream.Send(&gitalypb.FindChangedPathsBetweenCommitsResponse{ + Paths: t.paths, + }) +} + +func (s *server) validateCommon(ctx context.Context, name string, repo *gitalypb.Repository, commits []string) error { if _, err := s.locator.GetRepoPath(repo); err != nil { return err } - gitRepo := s.localrepo(in.GetRepository()) + gitRepo := s.localrepo(repo) - for _, commit := range in.GetCommits() { + for _, commit := range commits { if commit == "" { - return status.Errorf(codes.InvalidArgument, "FindChangedPaths: commits cannot contain an empty commit") + return status.Errorf(codes.InvalidArgument, "%s: commits cannot contain an empty commit", name) } containsRef, err := gitRepo.HasRevision(ctx, git.Revision(commit+"^{commit}")) @@ -147,9 +192,17 @@ func (s *server) validateFindChangedPathsRequestParams(ctx context.Context, in * } if !containsRef { - return status.Errorf(codes.NotFound, "FindChangedPaths: commit: %v can not be found", commit) + return status.Errorf(codes.NotFound, "%s: commit: %v can not be found", name, commit) } } return nil } + +func (s *server) validateFindChangedPathsRequestParams(ctx context.Context, in *gitalypb.FindChangedPathsRequest) error { + return s.validateCommon(ctx, "FindChangedPaths", in.GetRepository(), in.GetCommits()) +} + +func (s *server) validateFindChangedPathsBetweenCommitsRequestParams(ctx context.Context, in *gitalypb.FindChangedPathsBetweenCommitsRequest) error { + return s.validateCommon(ctx, "FindChangedPathsBetweenCommits", in.GetRepository(), []string{in.GetLeftCommitId(), in.GetRightCommitId()}) +} diff --git a/internal/gitaly/service/diff/find_changed_paths_test.go b/internal/gitaly/service/diff/find_changed_paths_test.go index 1b8f20aa799f5d5350345da626d05fefd889cb37..6ee93ffd359e9f897a53cb3e47b14b99385006c2 100644 --- a/internal/gitaly/service/diff/find_changed_paths_test.go +++ b/internal/gitaly/service/diff/find_changed_paths_test.go @@ -161,3 +161,173 @@ func TestFindChangedPathsRequest_failing(t *testing.T) { }) } } + +func TestFindChangedPathsBetweenCommitsRequest_success(t *testing.T) { + ctx := testhelper.Context(t) + _, repo, _, client := setupDiffService(ctx, t) + + testCases := []struct { + desc string + leftCommit string + rightCommit string + expectedPaths []*gitalypb.ChangedPaths + }{ + { + desc: "Returns the expected results between distant commits", + leftCommit: "54fcc214b94e78d7a41a9a8fe6d87a5e59500e51", + rightCommit: "5b4bb08538b9249995b94aa69121365ba9d28082", + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_DELETED, + Path: []byte("CONTRIBUTING.md"), + }, + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("NEW_FILE.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("README.md"), + }, + }, + }, + { + desc: "Returns the expected results when a file is renamed", + leftCommit: "e63f41fe459e62e1228fcef60d7189127aeba95a", + rightCommit: "94bb47ca1297b7b3731ff2a36923640991e9236f", + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_DELETED, + Path: []byte("CHANGELOG"), + }, + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("CHANGELOG.md"), + }, + }, + }, + { + desc: "Returns the expected results with diverging commits", + leftCommit: "5b4bb08538b9249995b94aa69121365ba9d28082", + rightCommit: "f0f390655872bb2772c85a0128b2fbc2d88670cb", + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("CONTRIBUTING.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("NEW_FILE.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("README.md"), + }, + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.desc, func(t *testing.T) { + rpcRequest := &gitalypb.FindChangedPathsBetweenCommitsRequest{Repository: repo, LeftCommitId: tc.leftCommit, RightCommitId: tc.rightCommit} + + stream, err := client.FindChangedPathsBetweenCommits(ctx, rpcRequest) + require.NoError(t, err) + + var paths []*gitalypb.ChangedPaths + for { + fetchedPaths, err := stream.Recv() + if err == io.EOF { + break + } + + require.NoError(t, err) + + paths = append(paths, fetchedPaths.GetPaths()...) + } + + require.Equal(t, tc.expectedPaths, paths) + }) + } +} + +func TestFindChangedPathsBetweenCommitsRequest_failing(t *testing.T) { + ctx := testhelper.Context(t) + cfg, repo, _, client := setupDiffService(ctx, t, testserver.WithDisablePraefect()) + + tests := []struct { + desc string + repo *gitalypb.Repository + leftCommit string + rightCommit string + err error + }{ + { + desc: "Repo not found", + repo: &gitalypb.Repository{StorageName: repo.GetStorageName(), RelativePath: "bar.git"}, + leftCommit: "742518b2be68fc750bb4c357c0df821a88113286", + rightCommit: "e4003da16c1c2c3fc4567700121b17bf8e591c6c", + err: status.Errorf(codes.NotFound, "GetRepoPath: not a git repository: %q", filepath.Join(cfg.Storages[0].Path, "bar.git")), + }, + { + desc: "Storage not found", + repo: &gitalypb.Repository{StorageName: "foo", RelativePath: "bar.git"}, + leftCommit: "742518b2be68fc750bb4c357c0df821a88113286", + rightCommit: "e4003da16c1c2c3fc4567700121b17bf8e591c6c", + err: status.Error(codes.InvalidArgument, "GetStorageByName: no such storage: \"foo\""), + }, + { + desc: "Left commit cannot be an empty commit", + repo: repo, + leftCommit: "", + rightCommit: "e4003da16c1c2c3fc4567700121b17bf8e591c6c", + err: status.Error(codes.InvalidArgument, "FindChangedPathsBetweenCommits: commits cannot contain an empty commit"), + }, + { + desc: "Right commit cannot be an empty commit", + repo: repo, + leftCommit: "742518b2be68fc750bb4c357c0df821a88113286", + rightCommit: "", + err: status.Error(codes.InvalidArgument, "FindChangedPathsBetweenCommits: commits cannot contain an empty commit"), + }, + { + desc: "Invalid left commit", + repo: repo, + leftCommit: "invalidinvalidinvalid", + rightCommit: "e4003da16c1c2c3fc4567700121b17bf8e591c6c", + err: status.Error(codes.NotFound, "FindChangedPathsBetweenCommits: commit: invalidinvalidinvalid can not be found"), + }, + { + desc: "Invalid right commit", + repo: repo, + leftCommit: "742518b2be68fc750bb4c357c0df821a88113286", + rightCommit: "invalidinvalidinvalid", + err: status.Error(codes.NotFound, "FindChangedPathsBetweenCommits: commit: invalidinvalidinvalid can not be found"), + }, + { + desc: "Left commit not found", + repo: repo, + leftCommit: "z4003da16c1c2c3fc4567700121b17bf8e591c6c", + rightCommit: "e4003da16c1c2c3fc4567700121b17bf8e591c6c", + err: status.Error(codes.NotFound, "FindChangedPathsBetweenCommits: commit: z4003da16c1c2c3fc4567700121b17bf8e591c6c can not be found"), + }, + { + desc: "Right commit not found", + repo: repo, + leftCommit: "742518b2be68fc750bb4c357c0df821a88113286", + rightCommit: "z4003da16c1c2c3fc4567700121b17bf8e591c6c", + err: status.Error(codes.NotFound, "FindChangedPathsBetweenCommits: commit: z4003da16c1c2c3fc4567700121b17bf8e591c6c can not be found"), + }, + } + + for _, tc := range tests { + rpcRequest := &gitalypb.FindChangedPathsBetweenCommitsRequest{Repository: tc.repo, LeftCommitId: tc.leftCommit, RightCommitId: tc.rightCommit} + stream, err := client.FindChangedPathsBetweenCommits(ctx, rpcRequest) + require.NoError(t, err) + + t.Run(tc.desc, func(t *testing.T) { + _, err := stream.Recv() + testhelper.RequireGrpcError(t, tc.err, err) + }) + } +} diff --git a/proto/diff.proto b/proto/diff.proto index 22d7ab7ace31a8b0c78e86db48b5bb575544140c..2b49147e7bfcbcc4360ce8cb303fda61a5df64f4 100644 --- a/proto/diff.proto +++ b/proto/diff.proto @@ -53,6 +53,13 @@ service DiffService { }; } + // Return a list of files changed between commits along with the status of each file + rpc FindChangedPathsBetweenCommits(FindChangedPathsBetweenCommitsRequest) returns (stream FindChangedPathsBetweenCommitsResponse) { + option (op_type) = { + op: ACCESSOR + }; + } + } // This comment is left unintentionally blank. @@ -266,3 +273,19 @@ message ChangedPaths { // This comment is left unintentionally blank. Status status = 2; } + +// Given two commits, return the files changed. +message FindChangedPathsBetweenCommitsRequest { + // Repository containing the commits + Repository repository = 1 [(target_repository)=true]; + // "Before" commit to compare + string left_commit_id = 2; + // "After" commit to compare + string right_commit_id = 3; +} + +// Returns a list of files that have been changed between the commits given +message FindChangedPathsBetweenCommitsResponse { + // List of paths that have been changed + repeated ChangedPaths paths = 1; +} diff --git a/proto/go/gitalypb/diff.pb.go b/proto/go/gitalypb/diff.pb.go index b7246c6e15a967fb825dd55d686303943fb90559..260e908e568b9c3a159fc5244ec23e177afefe21 100644 --- a/proto/go/gitalypb/diff.pb.go +++ b/proto/go/gitalypb/diff.pb.go @@ -1268,6 +1268,122 @@ func (x *ChangedPaths) GetStatus() ChangedPaths_Status { return ChangedPaths_ADDED } +// Given two commits, return the files changed. +type FindChangedPathsBetweenCommitsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Repository containing the commits + Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` + // "Before" commit to compare + LeftCommitId string `protobuf:"bytes,2,opt,name=left_commit_id,json=leftCommitId,proto3" json:"left_commit_id,omitempty"` + // "After" commit to compare + RightCommitId string `protobuf:"bytes,3,opt,name=right_commit_id,json=rightCommitId,proto3" json:"right_commit_id,omitempty"` +} + +func (x *FindChangedPathsBetweenCommitsRequest) Reset() { + *x = FindChangedPathsBetweenCommitsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diff_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindChangedPathsBetweenCommitsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindChangedPathsBetweenCommitsRequest) ProtoMessage() {} + +func (x *FindChangedPathsBetweenCommitsRequest) ProtoReflect() protoreflect.Message { + mi := &file_diff_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindChangedPathsBetweenCommitsRequest.ProtoReflect.Descriptor instead. +func (*FindChangedPathsBetweenCommitsRequest) Descriptor() ([]byte, []int) { + return file_diff_proto_rawDescGZIP(), []int{15} +} + +func (x *FindChangedPathsBetweenCommitsRequest) GetRepository() *Repository { + if x != nil { + return x.Repository + } + return nil +} + +func (x *FindChangedPathsBetweenCommitsRequest) GetLeftCommitId() string { + if x != nil { + return x.LeftCommitId + } + return "" +} + +func (x *FindChangedPathsBetweenCommitsRequest) GetRightCommitId() string { + if x != nil { + return x.RightCommitId + } + return "" +} + +// Returns a list of files that have been changed between the commits given +type FindChangedPathsBetweenCommitsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of paths that have been changed + Paths []*ChangedPaths `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` +} + +func (x *FindChangedPathsBetweenCommitsResponse) Reset() { + *x = FindChangedPathsBetweenCommitsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_diff_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindChangedPathsBetweenCommitsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindChangedPathsBetweenCommitsResponse) ProtoMessage() {} + +func (x *FindChangedPathsBetweenCommitsResponse) ProtoReflect() protoreflect.Message { + mi := &file_diff_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindChangedPathsBetweenCommitsResponse.ProtoReflect.Descriptor instead. +func (*FindChangedPathsBetweenCommitsResponse) Descriptor() ([]byte, []int) { + return file_diff_proto_rawDescGZIP(), []int{16} +} + +func (x *FindChangedPathsBetweenCommitsResponse) GetPaths() []*ChangedPaths { + if x != nil { + return x.Paths + } + return nil +} + var File_diff_proto protoreflect.FileDescriptor var file_diff_proto_rawDesc = []byte{ @@ -1432,42 +1548,67 @@ var file_diff_proto_rawDesc = []byte{ 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, - 0x43, 0x4f, 0x50, 0x49, 0x45, 0x44, 0x10, 0x04, 0x32, 0xea, 0x03, 0x0a, 0x0b, 0x44, 0x69, 0x66, - 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x19, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, - 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x50, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x07, 0x52, 0x61, 0x77, - 0x44, 0x69, 0x66, 0x66, 0x12, 0x16, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, - 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, - 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, + 0x43, 0x4f, 0x50, 0x49, 0x45, 0x44, 0x10, 0x04, 0x22, 0xaf, 0x01, 0x0a, 0x25, 0x46, 0x69, 0x6e, + 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x42, 0x65, 0x74, + 0x77, 0x65, 0x65, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, + 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x24, 0x0a, 0x0e, + 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x65, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x69, 0x67, + 0x68, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x26, 0x46, 0x69, + 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x42, 0x65, + 0x74, 0x77, 0x65, 0x65, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, + 0x32, 0xf6, 0x04, 0x0a, 0x0b, 0x44, 0x69, 0x66, 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x4d, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x19, + 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, + 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x61, + 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, - 0x47, 0x0a, 0x08, 0x52, 0x61, 0x77, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x17, 0x2e, 0x67, 0x69, - 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x77, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, - 0x77, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, - 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x4a, 0x0a, 0x09, 0x44, 0x69, 0x66, 0x66, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x44, - 0x69, 0x66, 0x66, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, - 0x08, 0x02, 0x30, 0x01, 0x12, 0x5f, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, - 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, - 0x68, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, - 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, - 0x74, 0x68, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, - 0x02, 0x08, 0x02, 0x30, 0x01, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x67, - 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, 0x31, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x50, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x1a, + 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x65, + 0x6c, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x69, 0x74, + 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, + 0x01, 0x12, 0x44, 0x0a, 0x07, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x12, 0x16, 0x2e, 0x67, + 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, + 0x77, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, + 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x47, 0x0a, 0x08, 0x52, 0x61, 0x77, 0x50, 0x61, + 0x74, 0x63, 0x68, 0x12, 0x17, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x77, + 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, + 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x77, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, + 0x12, 0x4a, 0x0a, 0x09, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x18, 0x2e, + 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x61, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, + 0x2e, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x5f, 0x0a, 0x10, + 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, + 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x12, 0x89, 0x01, + 0x0a, 0x1e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, + 0x68, 0x73, 0x42, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, + 0x12, 0x2d, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x42, 0x65, 0x74, 0x77, 0x65, 0x65, + 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2e, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x42, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x30, 0x01, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, + 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, + 0x72, 0x67, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, 0x31, 0x35, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1483,56 +1624,62 @@ func file_diff_proto_rawDescGZIP() []byte { } var file_diff_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_diff_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_diff_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_diff_proto_goTypes = []interface{}{ - (CommitDiffRequest_DiffMode)(0), // 0: gitaly.CommitDiffRequest.DiffMode - (ChangedPaths_Status)(0), // 1: gitaly.ChangedPaths.Status - (*CommitDiffRequest)(nil), // 2: gitaly.CommitDiffRequest - (*CommitDiffResponse)(nil), // 3: gitaly.CommitDiffResponse - (*CommitDeltaRequest)(nil), // 4: gitaly.CommitDeltaRequest - (*CommitDelta)(nil), // 5: gitaly.CommitDelta - (*CommitDeltaResponse)(nil), // 6: gitaly.CommitDeltaResponse - (*RawDiffRequest)(nil), // 7: gitaly.RawDiffRequest - (*RawDiffResponse)(nil), // 8: gitaly.RawDiffResponse - (*RawPatchRequest)(nil), // 9: gitaly.RawPatchRequest - (*RawPatchResponse)(nil), // 10: gitaly.RawPatchResponse - (*DiffStatsRequest)(nil), // 11: gitaly.DiffStatsRequest - (*DiffStats)(nil), // 12: gitaly.DiffStats - (*DiffStatsResponse)(nil), // 13: gitaly.DiffStatsResponse - (*FindChangedPathsRequest)(nil), // 14: gitaly.FindChangedPathsRequest - (*FindChangedPathsResponse)(nil), // 15: gitaly.FindChangedPathsResponse - (*ChangedPaths)(nil), // 16: gitaly.ChangedPaths - (*Repository)(nil), // 17: gitaly.Repository + (CommitDiffRequest_DiffMode)(0), // 0: gitaly.CommitDiffRequest.DiffMode + (ChangedPaths_Status)(0), // 1: gitaly.ChangedPaths.Status + (*CommitDiffRequest)(nil), // 2: gitaly.CommitDiffRequest + (*CommitDiffResponse)(nil), // 3: gitaly.CommitDiffResponse + (*CommitDeltaRequest)(nil), // 4: gitaly.CommitDeltaRequest + (*CommitDelta)(nil), // 5: gitaly.CommitDelta + (*CommitDeltaResponse)(nil), // 6: gitaly.CommitDeltaResponse + (*RawDiffRequest)(nil), // 7: gitaly.RawDiffRequest + (*RawDiffResponse)(nil), // 8: gitaly.RawDiffResponse + (*RawPatchRequest)(nil), // 9: gitaly.RawPatchRequest + (*RawPatchResponse)(nil), // 10: gitaly.RawPatchResponse + (*DiffStatsRequest)(nil), // 11: gitaly.DiffStatsRequest + (*DiffStats)(nil), // 12: gitaly.DiffStats + (*DiffStatsResponse)(nil), // 13: gitaly.DiffStatsResponse + (*FindChangedPathsRequest)(nil), // 14: gitaly.FindChangedPathsRequest + (*FindChangedPathsResponse)(nil), // 15: gitaly.FindChangedPathsResponse + (*ChangedPaths)(nil), // 16: gitaly.ChangedPaths + (*FindChangedPathsBetweenCommitsRequest)(nil), // 17: gitaly.FindChangedPathsBetweenCommitsRequest + (*FindChangedPathsBetweenCommitsResponse)(nil), // 18: gitaly.FindChangedPathsBetweenCommitsResponse + (*Repository)(nil), // 19: gitaly.Repository } var file_diff_proto_depIdxs = []int32{ - 17, // 0: gitaly.CommitDiffRequest.repository:type_name -> gitaly.Repository + 19, // 0: gitaly.CommitDiffRequest.repository:type_name -> gitaly.Repository 0, // 1: gitaly.CommitDiffRequest.diff_mode:type_name -> gitaly.CommitDiffRequest.DiffMode - 17, // 2: gitaly.CommitDeltaRequest.repository:type_name -> gitaly.Repository + 19, // 2: gitaly.CommitDeltaRequest.repository:type_name -> gitaly.Repository 5, // 3: gitaly.CommitDeltaResponse.deltas:type_name -> gitaly.CommitDelta - 17, // 4: gitaly.RawDiffRequest.repository:type_name -> gitaly.Repository - 17, // 5: gitaly.RawPatchRequest.repository:type_name -> gitaly.Repository - 17, // 6: gitaly.DiffStatsRequest.repository:type_name -> gitaly.Repository + 19, // 4: gitaly.RawDiffRequest.repository:type_name -> gitaly.Repository + 19, // 5: gitaly.RawPatchRequest.repository:type_name -> gitaly.Repository + 19, // 6: gitaly.DiffStatsRequest.repository:type_name -> gitaly.Repository 12, // 7: gitaly.DiffStatsResponse.stats:type_name -> gitaly.DiffStats - 17, // 8: gitaly.FindChangedPathsRequest.repository:type_name -> gitaly.Repository + 19, // 8: gitaly.FindChangedPathsRequest.repository:type_name -> gitaly.Repository 16, // 9: gitaly.FindChangedPathsResponse.paths:type_name -> gitaly.ChangedPaths 1, // 10: gitaly.ChangedPaths.status:type_name -> gitaly.ChangedPaths.Status - 2, // 11: gitaly.DiffService.CommitDiff:input_type -> gitaly.CommitDiffRequest - 4, // 12: gitaly.DiffService.CommitDelta:input_type -> gitaly.CommitDeltaRequest - 7, // 13: gitaly.DiffService.RawDiff:input_type -> gitaly.RawDiffRequest - 9, // 14: gitaly.DiffService.RawPatch:input_type -> gitaly.RawPatchRequest - 11, // 15: gitaly.DiffService.DiffStats:input_type -> gitaly.DiffStatsRequest - 14, // 16: gitaly.DiffService.FindChangedPaths:input_type -> gitaly.FindChangedPathsRequest - 3, // 17: gitaly.DiffService.CommitDiff:output_type -> gitaly.CommitDiffResponse - 6, // 18: gitaly.DiffService.CommitDelta:output_type -> gitaly.CommitDeltaResponse - 8, // 19: gitaly.DiffService.RawDiff:output_type -> gitaly.RawDiffResponse - 10, // 20: gitaly.DiffService.RawPatch:output_type -> gitaly.RawPatchResponse - 13, // 21: gitaly.DiffService.DiffStats:output_type -> gitaly.DiffStatsResponse - 15, // 22: gitaly.DiffService.FindChangedPaths:output_type -> gitaly.FindChangedPathsResponse - 17, // [17:23] is the sub-list for method output_type - 11, // [11:17] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 19, // 11: gitaly.FindChangedPathsBetweenCommitsRequest.repository:type_name -> gitaly.Repository + 16, // 12: gitaly.FindChangedPathsBetweenCommitsResponse.paths:type_name -> gitaly.ChangedPaths + 2, // 13: gitaly.DiffService.CommitDiff:input_type -> gitaly.CommitDiffRequest + 4, // 14: gitaly.DiffService.CommitDelta:input_type -> gitaly.CommitDeltaRequest + 7, // 15: gitaly.DiffService.RawDiff:input_type -> gitaly.RawDiffRequest + 9, // 16: gitaly.DiffService.RawPatch:input_type -> gitaly.RawPatchRequest + 11, // 17: gitaly.DiffService.DiffStats:input_type -> gitaly.DiffStatsRequest + 14, // 18: gitaly.DiffService.FindChangedPaths:input_type -> gitaly.FindChangedPathsRequest + 17, // 19: gitaly.DiffService.FindChangedPathsBetweenCommits:input_type -> gitaly.FindChangedPathsBetweenCommitsRequest + 3, // 20: gitaly.DiffService.CommitDiff:output_type -> gitaly.CommitDiffResponse + 6, // 21: gitaly.DiffService.CommitDelta:output_type -> gitaly.CommitDeltaResponse + 8, // 22: gitaly.DiffService.RawDiff:output_type -> gitaly.RawDiffResponse + 10, // 23: gitaly.DiffService.RawPatch:output_type -> gitaly.RawPatchResponse + 13, // 24: gitaly.DiffService.DiffStats:output_type -> gitaly.DiffStatsResponse + 15, // 25: gitaly.DiffService.FindChangedPaths:output_type -> gitaly.FindChangedPathsResponse + 18, // 26: gitaly.DiffService.FindChangedPathsBetweenCommits:output_type -> gitaly.FindChangedPathsBetweenCommitsResponse + 20, // [20:27] is the sub-list for method output_type + 13, // [13:20] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_diff_proto_init() } @@ -1723,6 +1870,30 @@ func file_diff_proto_init() { return nil } } + file_diff_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindChangedPathsBetweenCommitsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diff_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindChangedPathsBetweenCommitsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1730,7 +1901,7 @@ func file_diff_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_diff_proto_rawDesc, NumEnums: 2, - NumMessages: 15, + NumMessages: 17, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/go/gitalypb/diff_grpc.pb.go b/proto/go/gitalypb/diff_grpc.pb.go index c946202b6350b34416340a735972bf89d9f317d8..9ffbfc4692a52ff69833df7147c29349ddaabbda 100644 --- a/proto/go/gitalypb/diff_grpc.pb.go +++ b/proto/go/gitalypb/diff_grpc.pb.go @@ -30,6 +30,8 @@ type DiffServiceClient interface { DiffStats(ctx context.Context, in *DiffStatsRequest, opts ...grpc.CallOption) (DiffService_DiffStatsClient, error) // Return a list of files changed along with the status of each file FindChangedPaths(ctx context.Context, in *FindChangedPathsRequest, opts ...grpc.CallOption) (DiffService_FindChangedPathsClient, error) + // Return a list of files changed between commits along with the status of each file + FindChangedPathsBetweenCommits(ctx context.Context, in *FindChangedPathsBetweenCommitsRequest, opts ...grpc.CallOption) (DiffService_FindChangedPathsBetweenCommitsClient, error) } type diffServiceClient struct { @@ -232,6 +234,38 @@ func (x *diffServiceFindChangedPathsClient) Recv() (*FindChangedPathsResponse, e return m, nil } +func (c *diffServiceClient) FindChangedPathsBetweenCommits(ctx context.Context, in *FindChangedPathsBetweenCommitsRequest, opts ...grpc.CallOption) (DiffService_FindChangedPathsBetweenCommitsClient, error) { + stream, err := c.cc.NewStream(ctx, &DiffService_ServiceDesc.Streams[6], "/gitaly.DiffService/FindChangedPathsBetweenCommits", opts...) + if err != nil { + return nil, err + } + x := &diffServiceFindChangedPathsBetweenCommitsClient{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 DiffService_FindChangedPathsBetweenCommitsClient interface { + Recv() (*FindChangedPathsBetweenCommitsResponse, error) + grpc.ClientStream +} + +type diffServiceFindChangedPathsBetweenCommitsClient struct { + grpc.ClientStream +} + +func (x *diffServiceFindChangedPathsBetweenCommitsClient) Recv() (*FindChangedPathsBetweenCommitsResponse, error) { + m := new(FindChangedPathsBetweenCommitsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // DiffServiceServer is the server API for DiffService service. // All implementations must embed UnimplementedDiffServiceServer // for forward compatibility @@ -248,6 +282,8 @@ type DiffServiceServer interface { DiffStats(*DiffStatsRequest, DiffService_DiffStatsServer) error // Return a list of files changed along with the status of each file FindChangedPaths(*FindChangedPathsRequest, DiffService_FindChangedPathsServer) error + // Return a list of files changed between commits along with the status of each file + FindChangedPathsBetweenCommits(*FindChangedPathsBetweenCommitsRequest, DiffService_FindChangedPathsBetweenCommitsServer) error mustEmbedUnimplementedDiffServiceServer() } @@ -273,6 +309,9 @@ func (UnimplementedDiffServiceServer) DiffStats(*DiffStatsRequest, DiffService_D func (UnimplementedDiffServiceServer) FindChangedPaths(*FindChangedPathsRequest, DiffService_FindChangedPathsServer) error { return status.Errorf(codes.Unimplemented, "method FindChangedPaths not implemented") } +func (UnimplementedDiffServiceServer) FindChangedPathsBetweenCommits(*FindChangedPathsBetweenCommitsRequest, DiffService_FindChangedPathsBetweenCommitsServer) error { + return status.Errorf(codes.Unimplemented, "method FindChangedPathsBetweenCommits not implemented") +} func (UnimplementedDiffServiceServer) mustEmbedUnimplementedDiffServiceServer() {} // UnsafeDiffServiceServer may be embedded to opt out of forward compatibility for this service. @@ -412,6 +451,27 @@ func (x *diffServiceFindChangedPathsServer) Send(m *FindChangedPathsResponse) er return x.ServerStream.SendMsg(m) } +func _DiffService_FindChangedPathsBetweenCommits_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(FindChangedPathsBetweenCommitsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(DiffServiceServer).FindChangedPathsBetweenCommits(m, &diffServiceFindChangedPathsBetweenCommitsServer{stream}) +} + +type DiffService_FindChangedPathsBetweenCommitsServer interface { + Send(*FindChangedPathsBetweenCommitsResponse) error + grpc.ServerStream +} + +type diffServiceFindChangedPathsBetweenCommitsServer struct { + grpc.ServerStream +} + +func (x *diffServiceFindChangedPathsBetweenCommitsServer) Send(m *FindChangedPathsBetweenCommitsResponse) error { + return x.ServerStream.SendMsg(m) +} + // DiffService_ServiceDesc is the grpc.ServiceDesc for DiffService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -450,6 +510,11 @@ var DiffService_ServiceDesc = grpc.ServiceDesc{ Handler: _DiffService_FindChangedPaths_Handler, ServerStreams: true, }, + { + StreamName: "FindChangedPathsBetweenCommits", + Handler: _DiffService_FindChangedPathsBetweenCommits_Handler, + ServerStreams: true, + }, }, Metadata: "diff.proto", } diff --git a/ruby/proto/gitaly/diff_pb.rb b/ruby/proto/gitaly/diff_pb.rb index 5a805b038003392f93006ee0574a563041eb5990..5b06492c63e8ab3dea4516eb30f6fab123e7a6bd 100644 --- a/ruby/proto/gitaly/diff_pb.rb +++ b/ruby/proto/gitaly/diff_pb.rb @@ -107,6 +107,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do value :TYPE_CHANGE, 3 value :COPIED, 4 end + add_message "gitaly.FindChangedPathsBetweenCommitsRequest" do + optional :repository, :message, 1, "gitaly.Repository" + optional :left_commit_id, :string, 2 + optional :right_commit_id, :string, 3 + end + add_message "gitaly.FindChangedPathsBetweenCommitsResponse" do + repeated :paths, :message, 1, "gitaly.ChangedPaths" + end end end @@ -128,4 +136,6 @@ module Gitaly FindChangedPathsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindChangedPathsResponse").msgclass ChangedPaths = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ChangedPaths").msgclass ChangedPaths::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ChangedPaths.Status").enummodule + FindChangedPathsBetweenCommitsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindChangedPathsBetweenCommitsRequest").msgclass + FindChangedPathsBetweenCommitsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindChangedPathsBetweenCommitsResponse").msgclass end diff --git a/ruby/proto/gitaly/diff_services_pb.rb b/ruby/proto/gitaly/diff_services_pb.rb index c325ed65ebff025aeda67c1b1211f94de8f56096..0747858e600accab10a8a4ecd26e9e1df541c2fa 100644 --- a/ruby/proto/gitaly/diff_services_pb.rb +++ b/ruby/proto/gitaly/diff_services_pb.rb @@ -28,6 +28,8 @@ module Gitaly rpc :DiffStats, ::Gitaly::DiffStatsRequest, stream(::Gitaly::DiffStatsResponse) # Return a list of files changed along with the status of each file rpc :FindChangedPaths, ::Gitaly::FindChangedPathsRequest, stream(::Gitaly::FindChangedPathsResponse) + # Return a list of files changed between commits along with the status of each file + rpc :FindChangedPathsBetweenCommits, ::Gitaly::FindChangedPathsBetweenCommitsRequest, stream(::Gitaly::FindChangedPathsBetweenCommitsResponse) end Stub = Service.rpc_stub_class