diff options
author | Will Chandler <wchandler@gitlab.com> | 2022-06-15 23:31:42 +0300 |
---|---|---|
committer | Will Chandler <wchandler@gitlab.com> | 2022-06-15 23:31:42 +0300 |
commit | b909c437560c36c85c80fe9891df7f0dc9cbc693 (patch) | |
tree | da5a7f4246eeda330683739766a2120874520c1f | |
parent | 96e6852003980a58d50cf3cd16c23c3f6bc367f0 (diff) | |
parent | 101e4d2c53d0233c919f560922e33b97d875a770 (diff) |
Merge branch 'find-changed-paths-commit-pairs' into 'master'
FindChangedPaths: Add requests field
See merge request gitlab-org/gitaly!4597
-rw-r--r-- | internal/gitaly/service/diff/find_changed_paths.go | 125 | ||||
-rw-r--r-- | internal/gitaly/service/diff/find_changed_paths_test.go | 391 | ||||
-rw-r--r-- | proto/diff.proto | 40 | ||||
-rw-r--r-- | proto/go/gitalypb/diff.pb.go | 502 | ||||
-rw-r--r-- | ruby/proto/gitaly/diff_pb.rb | 18 |
5 files changed, 932 insertions, 144 deletions
diff --git a/internal/gitaly/service/diff/find_changed_paths.go b/internal/gitaly/service/diff/find_changed_paths.go index 01a2a4f45..743e9216f 100644 --- a/internal/gitaly/service/diff/find_changed_paths.go +++ b/internal/gitaly/service/diff/find_changed_paths.go @@ -2,15 +2,18 @@ package diff import ( "bufio" + "bytes" "context" + "errors" "fmt" "io" "strings" "gitlab.com/gitlab-org/gitaly/v15/internal/git" + "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" + "gitlab.com/gitlab-org/gitaly/v15/internal/helper" "gitlab.com/gitlab-org/gitaly/v15/internal/helper/chunk" "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) @@ -19,6 +22,20 @@ const ( numStatDelimiter = 0 ) +// changedPathsRequestToString converts the given FindChangedPathsRequest to a string that can be passed to git-diff-tree(1). Note +// that this function expects that all revisions have already been resolved to their respective object IDs. +func changedPathsRequestToString(r *gitalypb.FindChangedPathsRequest_Request) (string, error) { + switch t := r.GetType().(type) { + case *gitalypb.FindChangedPathsRequest_Request_CommitRequest_: + return strings.Join(append([]string{t.CommitRequest.GetCommitRevision()}, t.CommitRequest.GetParentCommitRevisions()...), " "), nil + case *gitalypb.FindChangedPathsRequest_Request_TreeRequest_: + return t.TreeRequest.GetLeftTreeRevision() + " " + t.TreeRequest.GetRightTreeRevision(), nil + } + + // This shouldn't happen + return "", fmt.Errorf("unknown FindChangedPathsRequest type") +} + func (s *server) FindChangedPaths(in *gitalypb.FindChangedPathsRequest, stream gitalypb.DiffService_FindChangedPathsServer) error { if err := s.validateFindChangedPathsRequestParams(stream.Context(), in); err != nil { return err @@ -26,6 +43,15 @@ func (s *server) FindChangedPaths(in *gitalypb.FindChangedPathsRequest, stream g diffChunker := chunk.New(&findChangedPathsSender{stream: stream}) + requests := make([]string, len(in.GetRequests())) + for i, request := range in.GetRequests() { + str, err := changedPathsRequestToString(request) + if err != nil { + return err + } + requests[i] = str + } + cmd, err := s.gitCmdFactory.New(stream.Context(), in.Repository, git.SubCmd{ Name: "diff-tree", Flags: []git.Option{ @@ -33,25 +59,24 @@ func (s *server) FindChangedPaths(in *gitalypb.FindChangedPathsRequest, stream g 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"))) + }, git.WithStdin(strings.NewReader(strings.Join(requests, "\n")+"\n"))) if err != nil { if _, ok := status.FromError(err); ok { - return fmt.Errorf("FindChangedPaths Stdin Err: %w", err) + return fmt.Errorf("stdin err: %w", err) } - return status.Errorf(codes.Internal, "FindChangedPaths: Cmd Err: %v", err) + return helper.ErrInternalf("cmd err: %v", err) } if err := parsePaths(bufio.NewReader(cmd), diffChunker); err != nil { - return fmt.Errorf("FindChangedPaths Parsing Err: %w", err) + return fmt.Errorf("parsing err: %w", err) } if err := cmd.Wait(); err != nil { - return status.Errorf(codes.Unavailable, "FindChangedPaths: Cmd Wait Err: %v", err) + return helper.ErrUnavailablef("cmd wait err: %v", err) } return diffChunker.Flush() @@ -65,11 +90,11 @@ func parsePaths(reader *bufio.Reader, chunker *chunk.Chunker) error { break } - return fmt.Errorf("FindChangedPaths Next Path Err: %w", err) + return fmt.Errorf("next path err: %w", err) } if err := chunker.Send(path); err != nil { - return fmt.Errorf("FindChangedPaths: err sending to chunker: %v", err) + return fmt.Errorf("err sending to chunker: %v", err) } } @@ -77,11 +102,22 @@ func parsePaths(reader *bufio.Reader, chunker *chunk.Chunker) error { } func nextPath(reader *bufio.Reader) (*gitalypb.ChangedPaths, error) { - pathStatus, err := reader.ReadBytes(numStatDelimiter) + _, err := reader.ReadBytes(':') if err != nil { return nil, err } + line, err := reader.ReadBytes(numStatDelimiter) + if err != nil { + return nil, err + } + split := bytes.Split(line[:len(line)-1], []byte(" ")) + if len(split) != 5 || len(split[4]) != 1 { + return nil, fmt.Errorf("git diff-tree parsing failed on: %v", line) + } + + pathStatus := split[4] + path, err := reader.ReadBytes(numStatDelimiter) if err != nil { return nil, err @@ -95,9 +131,9 @@ func nextPath(reader *bufio.Reader) (*gitalypb.ChangedPaths, error) { "A": gitalypb.ChangedPaths_ADDED, } - parsedPath, ok := statusTypeMap[string(pathStatus[:len(pathStatus)-1])] + parsedPath, ok := statusTypeMap[string(pathStatus)] if !ok { - return nil, status.Errorf(codes.Internal, "FindChangedPaths: Unknown changed paths returned: %v", string(pathStatus)) + return nil, helper.ErrInternalf("unknown changed paths returned: %v", string(pathStatus)) } changedPath := &gitalypb.ChangedPaths{ @@ -128,6 +164,22 @@ func (t *findChangedPathsSender) Send() error { }) } +func resolveObjectWithType(ctx context.Context, repo *localrepo.Repo, revision string, expectedType string) (git.ObjectID, error) { + if revision == "" { + return "", helper.ErrInvalidArgumentf("revision cannot be empty") + } + + oid, err := repo.ResolveRevision(ctx, git.Revision(fmt.Sprintf("%s^{%s}", revision, expectedType))) + if err != nil { + if errors.Is(err, git.ErrReferenceNotFound) { + return "", helper.ErrNotFoundf("revision can not be found: %q", revision) + } + return "", err + } + + return oid, nil +} + func (s *server) validateFindChangedPathsRequestParams(ctx context.Context, in *gitalypb.FindChangedPathsRequest) error { repo := in.GetRepository() if _, err := s.locator.GetRepoPath(repo); err != nil { @@ -136,18 +188,51 @@ func (s *server) validateFindChangedPathsRequestParams(ctx context.Context, in * gitRepo := s.localrepo(in.GetRepository()) - for _, commit := range in.GetCommits() { - if commit == "" { - return status.Errorf(codes.InvalidArgument, "FindChangedPaths: commits cannot contain an empty commit") + if len(in.GetCommits()) > 0 { //nolint:staticcheck + if len(in.GetRequests()) > 0 { + return helper.ErrInvalidArgumentf("cannot specify both commits and requests") } - containsRef, err := gitRepo.HasRevision(ctx, git.Revision(commit+"^{commit}")) - if err != nil { - return fmt.Errorf("contains ref err: %w", err) + in.Requests = make([]*gitalypb.FindChangedPathsRequest_Request, len(in.GetCommits())) //nolint:staticcheck + for i, commit := range in.GetCommits() { //nolint:staticcheck + in.Requests[i] = &gitalypb.FindChangedPathsRequest_Request{ + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: commit, + }, + }, + } } + } - if !containsRef { - return status.Errorf(codes.NotFound, "FindChangedPaths: commit: %v can not be found", commit) + for _, request := range in.GetRequests() { + switch t := request.Type.(type) { + case *gitalypb.FindChangedPathsRequest_Request_CommitRequest_: + oid, err := resolveObjectWithType(ctx, gitRepo, t.CommitRequest.GetCommitRevision(), "commit") + if err != nil { + return helper.ErrInternalf("resolving commit: %w", err) + } + t.CommitRequest.CommitRevision = oid.String() + + for i, commit := range t.CommitRequest.GetParentCommitRevisions() { + oid, err := resolveObjectWithType(ctx, gitRepo, commit, "commit") + if err != nil { + return helper.ErrInternalf("resolving commit parent: %w", err) + } + t.CommitRequest.ParentCommitRevisions[i] = oid.String() + } + case *gitalypb.FindChangedPathsRequest_Request_TreeRequest_: + oid, err := resolveObjectWithType(ctx, gitRepo, t.TreeRequest.GetLeftTreeRevision(), "tree") + if err != nil { + return helper.ErrInternalf("resolving left tree: %w", err) + } + t.TreeRequest.LeftTreeRevision = oid.String() + + oid, err = resolveObjectWithType(ctx, gitRepo, t.TreeRequest.GetRightTreeRevision(), "tree") + if err != nil { + return helper.ErrInternalf("resolving right tree: %w", err) + } + t.TreeRequest.RightTreeRevision = oid.String() } } diff --git a/internal/gitaly/service/diff/find_changed_paths_test.go b/internal/gitaly/service/diff/find_changed_paths_test.go index 1b8f20aa7..a4e899c9a 100644 --- a/internal/gitaly/service/diff/find_changed_paths_test.go +++ b/internal/gitaly/service/diff/find_changed_paths_test.go @@ -6,11 +6,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly/v15/internal/helper" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper/testserver" "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func TestFindChangedPathsRequest_success(t *testing.T) { @@ -20,12 +19,13 @@ func TestFindChangedPathsRequest_success(t *testing.T) { testCases := []struct { desc string commits []string + requests []*gitalypb.FindChangedPathsRequest_Request expectedPaths []*gitalypb.ChangedPaths }{ { - "Returns the expected results without a merge commit", - []string{"e4003da16c1c2c3fc4567700121b17bf8e591c6c", "57290e673a4c87f51294f5216672cbc58d485d25", "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab", "d59c60028b053793cecfb4022de34602e1a9218e"}, - []*gitalypb.ChangedPaths{ + desc: "Returns the expected results without a merge commit", + commits: []string{"e4003da16c1c2c3fc4567700121b17bf8e591c6c", "57290e673a4c87f51294f5216672cbc58d485d25", "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab", "d59c60028b053793cecfb4022de34602e1a9218e"}, + expectedPaths: []*gitalypb.ChangedPaths{ { Status: gitalypb.ChangedPaths_MODIFIED, Path: []byte("CONTRIBUTING.md"), @@ -69,9 +69,9 @@ func TestFindChangedPathsRequest_success(t *testing.T) { }, }, { - "Returns the expected results with a merge commit", - []string{"7975be0116940bf2ad4321f79d02a55c5f7779aa", "55bc176024cfa3baaceb71db584c7e5df900ea65"}, - []*gitalypb.ChangedPaths{ + desc: "Returns the expected results with a merge commit", + commits: []string{"7975be0116940bf2ad4321f79d02a55c5f7779aa", "55bc176024cfa3baaceb71db584c7e5df900ea65"}, + expectedPaths: []*gitalypb.ChangedPaths{ { Status: gitalypb.ChangedPaths_ADDED, Path: []byte("files/images/emoji.png"), @@ -82,11 +82,287 @@ func TestFindChangedPathsRequest_success(t *testing.T) { }, }, }, + { + desc: "Commit request without parents uses actual parents", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "5b4bb08538b9249995b94aa69121365ba9d28082", + }, + }, + }, + }, + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("NEW_FILE.md"), + }, + }, + }, + { + desc: "Returns the expected results between distant commits", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "5b4bb08538b9249995b94aa69121365ba9d28082", + ParentCommitRevisions: []string{ + "54fcc214b94e78d7a41a9a8fe6d87a5e59500e51", + }, + }, + }, + }, + }, + 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", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "94bb47ca1297b7b3731ff2a36923640991e9236f", + ParentCommitRevisions: []string{ + "e63f41fe459e62e1228fcef60d7189127aeba95a", + }, + }, + }, + }, + }, + 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", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "f0f390655872bb2772c85a0128b2fbc2d88670cb", + ParentCommitRevisions: []string{ + "5b4bb08538b9249995b94aa69121365ba9d28082", + }, + }, + }, + }, + }, + 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"), + }, + }, + }, + { + desc: "Returns the expected results with trees", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_TreeRequest_{ + TreeRequest: &gitalypb.FindChangedPathsRequest_Request_TreeRequest{ + LeftTreeRevision: "05b1cb35ce45609df9de644c62db980a4b6e8814", + RightTreeRevision: "7b06af2882bea3c0433955883bb65217256a634e", + }, + }, + }, + }, + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("CONTRIBUTING.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("README.md"), + }, + }, + }, + { + desc: "Returns the expected results when multiple parent commits are specified", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "5b4bb08538b9249995b94aa69121365ba9d28082", + ParentCommitRevisions: []string{ + "5d03ab53225e8d8fe4f0597c70fc21c6542a7a10", + "f0f390655872bb2772c85a0128b2fbc2d88670cb", + }, + }, + }, + }, + }, + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("NEW_FILE.md"), + }, + { + Status: gitalypb.ChangedPaths_DELETED, + Path: []byte("CONTRIBUTING.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("NEW_FILE.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("README.md"), + }, + }, + }, + { + desc: "Returns the expected results with multiple requests", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_TreeRequest_{ + TreeRequest: &gitalypb.FindChangedPathsRequest_Request_TreeRequest{ + LeftTreeRevision: "05b1cb35ce45609df9de644c62db980a4b6e8814", + RightTreeRevision: "7b06af2882bea3c0433955883bb65217256a634e", + }, + }, + }, + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "5b4bb08538b9249995b94aa69121365ba9d28082", + ParentCommitRevisions: []string{ + "5d03ab53225e8d8fe4f0597c70fc21c6542a7a10", + "f0f390655872bb2772c85a0128b2fbc2d88670cb", + }, + }, + }, + }, + { + Type: &gitalypb.FindChangedPathsRequest_Request_TreeRequest_{ + TreeRequest: &gitalypb.FindChangedPathsRequest_Request_TreeRequest{ + LeftTreeRevision: "05b1cb35ce45609df9de644c62db980a4b6e8814", + RightTreeRevision: "7b06af2882bea3c0433955883bb65217256a634e", + }, + }, + }, + }, + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("CONTRIBUTING.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("README.md"), + }, + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("NEW_FILE.md"), + }, + { + Status: gitalypb.ChangedPaths_DELETED, + Path: []byte("CONTRIBUTING.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("NEW_FILE.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("README.md"), + }, + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("CONTRIBUTING.md"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte("README.md"), + }, + }, + }, + { + desc: "Returns the expected results with refs and tags as commits", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "v1.0.0", + ParentCommitRevisions: []string{ + "v1.0.0^^", + }, + }, + }, + }, + }, + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_DELETED, + Path: []byte(".DS_Store"), + }, + { + Status: gitalypb.ChangedPaths_MODIFIED, + Path: []byte(".gitmodules"), + }, + { + Status: gitalypb.ChangedPaths_DELETED, + Path: []byte("files/.DS_Store"), + }, + { + Status: gitalypb.ChangedPaths_ADDED, + Path: []byte("gitlab-shell"), + }, + }, + }, + { + desc: "Returns the expected results with commits as trees", + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_TreeRequest_{ + TreeRequest: &gitalypb.FindChangedPathsRequest_Request_TreeRequest{ + LeftTreeRevision: "54fcc214b94e78d7a41a9a8fe6d87a5e59500e51", + RightTreeRevision: "be93687618e4b132087f430a4d8fc3a609c9b77c", + }, + }, + }, + }, + expectedPaths: []*gitalypb.ChangedPaths{ + { + Status: gitalypb.ChangedPaths_DELETED, + Path: []byte("README"), + }, + }, + }, } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rpcRequest := &gitalypb.FindChangedPathsRequest{Repository: repo, Commits: tc.commits} + rpcRequest := &gitalypb.FindChangedPathsRequest{Repository: repo, Commits: tc.commits, Requests: tc.requests} stream, err := client.FindChangedPaths(ctx, rpcRequest) require.NoError(t, err) @@ -113,45 +389,122 @@ func TestFindChangedPathsRequest_failing(t *testing.T) { cfg, repo, _, client := setupDiffService(ctx, t, testserver.WithDisablePraefect()) tests := []struct { - desc string - repo *gitalypb.Repository - commits []string - err error + desc string + repo *gitalypb.Repository + commits []string + requests []*gitalypb.FindChangedPathsRequest_Request + err error }{ { desc: "Repo not found", repo: &gitalypb.Repository{StorageName: repo.GetStorageName(), RelativePath: "bar.git"}, commits: []string{"e4003da16c1c2c3fc4567700121b17bf8e591c6c", "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab"}, - err: status.Errorf(codes.NotFound, "GetRepoPath: not a git repository: %q", filepath.Join(cfg.Storages[0].Path, "bar.git")), + err: helper.ErrNotFoundf("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"}, commits: []string{"e4003da16c1c2c3fc4567700121b17bf8e591c6c", "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab"}, - err: status.Error(codes.InvalidArgument, "GetStorageByName: no such storage: \"foo\""), + err: helper.ErrInvalidArgumentf("GetStorageByName: no such storage: \"foo\""), }, { desc: "Commits cannot contain an empty commit", repo: repo, commits: []string{""}, - err: status.Error(codes.InvalidArgument, "FindChangedPaths: commits cannot contain an empty commit"), + err: helper.ErrInvalidArgumentf("resolving commit: revision cannot be empty"), + }, + { + desc: "Specifying both commits and requests", + repo: repo, + commits: []string{"8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab"}, + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab", + }, + }, + }, + }, + err: helper.ErrInvalidArgumentf("cannot specify both commits and requests"), }, { desc: "Invalid commit", repo: repo, commits: []string{"invalidinvalidinvalid", "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab"}, - err: status.Error(codes.NotFound, "FindChangedPaths: commit: invalidinvalidinvalid can not be found"), + err: helper.ErrNotFoundf(`resolving commit: revision can not be found: "invalidinvalidinvalid"`), }, { desc: "Commit not found", repo: repo, commits: []string{"z4003da16c1c2c3fc4567700121b17bf8e591c6c", "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab"}, - err: status.Error(codes.NotFound, "FindChangedPaths: commit: z4003da16c1c2c3fc4567700121b17bf8e591c6c can not be found"), + err: helper.ErrNotFoundf(`resolving commit: revision can not be found: "z4003da16c1c2c3fc4567700121b17bf8e591c6c"`), + }, + { + desc: "Tree object as commit", + repo: repo, + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "07f8147e8e73aab6c935c296e8cdc5194dee729b", + }, + }, + }, + }, + err: helper.ErrNotFoundf(`resolving commit: revision can not be found: "07f8147e8e73aab6c935c296e8cdc5194dee729b"`), + }, + { + desc: "Tree object as parent commit", + repo: repo, + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_CommitRequest_{ + CommitRequest: &gitalypb.FindChangedPathsRequest_Request_CommitRequest{ + CommitRevision: "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab", + ParentCommitRevisions: []string{ + "07f8147e8e73aab6c935c296e8cdc5194dee729b", + }, + }, + }, + }, + }, + err: helper.ErrNotFoundf(`resolving commit parent: revision can not be found: "07f8147e8e73aab6c935c296e8cdc5194dee729b"`), + }, + { + desc: "Blob object as left tree", + repo: repo, + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_TreeRequest_{ + TreeRequest: &gitalypb.FindChangedPathsRequest_Request_TreeRequest{ + LeftTreeRevision: "50b27c6518be44c42c4d87966ae2481ce895624c", + RightTreeRevision: "07f8147e8e73aab6c935c296e8cdc5194dee729b", + }, + }, + }, + }, + err: helper.ErrNotFoundf(`resolving left tree: revision can not be found: "50b27c6518be44c42c4d87966ae2481ce895624c"`), + }, + { + desc: "Blob object as right tree", + repo: repo, + requests: []*gitalypb.FindChangedPathsRequest_Request{ + { + Type: &gitalypb.FindChangedPathsRequest_Request_TreeRequest_{ + TreeRequest: &gitalypb.FindChangedPathsRequest_Request_TreeRequest{ + LeftTreeRevision: "07f8147e8e73aab6c935c296e8cdc5194dee729b", + RightTreeRevision: "50b27c6518be44c42c4d87966ae2481ce895624c", + }, + }, + }, + }, + err: helper.ErrNotFoundf(`resolving right tree: revision can not be found: "50b27c6518be44c42c4d87966ae2481ce895624c"`), }, } for _, tc := range tests { - rpcRequest := &gitalypb.FindChangedPathsRequest{Repository: tc.repo, Commits: tc.commits} + rpcRequest := &gitalypb.FindChangedPathsRequest{Repository: tc.repo, Commits: tc.commits, Requests: tc.requests} stream, err := client.FindChangedPaths(ctx, rpcRequest) require.NoError(t, err) diff --git a/proto/diff.proto b/proto/diff.proto index 22d7ab7ac..377cc7088 100644 --- a/proto/diff.proto +++ b/proto/diff.proto @@ -233,10 +233,46 @@ message DiffStatsResponse { // to its parent. Merge commits will show files which are different to all of // its parents. message FindChangedPathsRequest { + // Request is a single request to pass to git diff-tree. + message Request { + // TreeRequest compares two trees. + message TreeRequest { + // left_tree_revision is the revision of the left tree to compare. Accepts any revision that + // peels to a tree object. + string left_tree_revision = 1; + // right_tree_revision is the revision of the right tree to compare. Accepts any revision that + // peels to a tree object. + string right_tree_revision = 2; + } + + // CommitRequest compares a commit to its parents (or some other commits.) + message CommitRequest { + // commit_revision is the revision of the commit that should be compared. If no `parent_commit_revisions` + // are given, then the commit will be compared against its parents. The revision needs to peel to a + // commit object. + string commit_revision = 1; + // parent_commit_revisions are the revisions of commits to treat as the commit's parents. This is an + // optional field: if not specified, the actual parents of the commit referred to by `commit_revision` + // are used. + repeated string parent_commit_revisions = 2; + } + + oneof type { + // tree_request is a request comparing two trees with each other. + TreeRequest tree_request = 1; + // commit_request is a request comparing one or more commits with each other. + CommitRequest commit_request = 2; + } + } + // This comment is left unintentionally blank. Repository repository = 1 [(target_repository)=true]; - // This comment is left unintentionally blank. - repeated string commits = 2; + // commits is the list of commits to compare to their parents. This field is deprecated. To adapt to the new calling + // convention you can create one `CommitRequest` per commit, where each `CommitRequest` has only the `commit_revision` + // field. + repeated string commits = 2 [deprecated=true]; + // requests specifies the requests of what to compare. + repeated Request requests = 3; } // Returns a list of files that have been changed in the commits given diff --git a/proto/go/gitalypb/diff.pb.go b/proto/go/gitalypb/diff.pb.go index 01575a47d..e6f0f6eec 100644 --- a/proto/go/gitalypb/diff.pb.go +++ b/proto/go/gitalypb/diff.pb.go @@ -1111,8 +1111,14 @@ type FindChangedPathsRequest struct { // This comment is left unintentionally blank. Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - // This comment is left unintentionally blank. + // commits is the list of commits to compare to their parents. This field is deprecated. To adapt to the new calling + // convention you can create one `CommitRequest` per commit, where each `CommitRequest` has only the `commit_revision` + // field. + // + // Deprecated: Do not use. Commits []string `protobuf:"bytes,2,rep,name=commits,proto3" json:"commits,omitempty"` + // requests specifies the requests of what to compare. + Requests []*FindChangedPathsRequest_Request `protobuf:"bytes,3,rep,name=requests,proto3" json:"requests,omitempty"` } func (x *FindChangedPathsRequest) Reset() { @@ -1154,6 +1160,7 @@ func (x *FindChangedPathsRequest) GetRepository() *Repository { return nil } +// Deprecated: Do not use. func (x *FindChangedPathsRequest) GetCommits() []string { if x != nil { return x.Commits @@ -1161,6 +1168,13 @@ func (x *FindChangedPathsRequest) GetCommits() []string { return nil } +func (x *FindChangedPathsRequest) GetRequests() []*FindChangedPathsRequest_Request { + if x != nil { + return x.Requests + } + return nil +} + // Returns a list of files that have been changed in the commits given type FindChangedPathsResponse struct { state protoimpl.MessageState @@ -1268,6 +1282,211 @@ func (x *ChangedPaths) GetStatus() ChangedPaths_Status { return ChangedPaths_ADDED } +// Request is a single request to pass to git diff-tree. +type FindChangedPathsRequest_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // *FindChangedPathsRequest_Request_TreeRequest_ + // *FindChangedPathsRequest_Request_CommitRequest_ + Type isFindChangedPathsRequest_Request_Type `protobuf_oneof:"type"` +} + +func (x *FindChangedPathsRequest_Request) Reset() { + *x = FindChangedPathsRequest_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_diff_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindChangedPathsRequest_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindChangedPathsRequest_Request) ProtoMessage() {} + +func (x *FindChangedPathsRequest_Request) 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 FindChangedPathsRequest_Request.ProtoReflect.Descriptor instead. +func (*FindChangedPathsRequest_Request) Descriptor() ([]byte, []int) { + return file_diff_proto_rawDescGZIP(), []int{12, 0} +} + +func (m *FindChangedPathsRequest_Request) GetType() isFindChangedPathsRequest_Request_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *FindChangedPathsRequest_Request) GetTreeRequest() *FindChangedPathsRequest_Request_TreeRequest { + if x, ok := x.GetType().(*FindChangedPathsRequest_Request_TreeRequest_); ok { + return x.TreeRequest + } + return nil +} + +func (x *FindChangedPathsRequest_Request) GetCommitRequest() *FindChangedPathsRequest_Request_CommitRequest { + if x, ok := x.GetType().(*FindChangedPathsRequest_Request_CommitRequest_); ok { + return x.CommitRequest + } + return nil +} + +type isFindChangedPathsRequest_Request_Type interface { + isFindChangedPathsRequest_Request_Type() +} + +type FindChangedPathsRequest_Request_TreeRequest_ struct { + // tree_request is a request comparing two trees with each other. + TreeRequest *FindChangedPathsRequest_Request_TreeRequest `protobuf:"bytes,1,opt,name=tree_request,json=treeRequest,proto3,oneof"` +} + +type FindChangedPathsRequest_Request_CommitRequest_ struct { + // commit_request is a request comparing one or more commits with each other. + CommitRequest *FindChangedPathsRequest_Request_CommitRequest `protobuf:"bytes,2,opt,name=commit_request,json=commitRequest,proto3,oneof"` +} + +func (*FindChangedPathsRequest_Request_TreeRequest_) isFindChangedPathsRequest_Request_Type() {} + +func (*FindChangedPathsRequest_Request_CommitRequest_) isFindChangedPathsRequest_Request_Type() {} + +// TreeRequest compares two trees. +type FindChangedPathsRequest_Request_TreeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // left_tree_revision is the revision of the left tree to compare. Accepts any revision that + // peels to a tree object. + LeftTreeRevision string `protobuf:"bytes,1,opt,name=left_tree_revision,json=leftTreeRevision,proto3" json:"left_tree_revision,omitempty"` + // right_tree_revision is the revision of the right tree to compare. Accepts any revision that + // peels to a tree object. + RightTreeRevision string `protobuf:"bytes,2,opt,name=right_tree_revision,json=rightTreeRevision,proto3" json:"right_tree_revision,omitempty"` +} + +func (x *FindChangedPathsRequest_Request_TreeRequest) Reset() { + *x = FindChangedPathsRequest_Request_TreeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diff_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindChangedPathsRequest_Request_TreeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindChangedPathsRequest_Request_TreeRequest) ProtoMessage() {} + +func (x *FindChangedPathsRequest_Request_TreeRequest) 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 FindChangedPathsRequest_Request_TreeRequest.ProtoReflect.Descriptor instead. +func (*FindChangedPathsRequest_Request_TreeRequest) Descriptor() ([]byte, []int) { + return file_diff_proto_rawDescGZIP(), []int{12, 0, 0} +} + +func (x *FindChangedPathsRequest_Request_TreeRequest) GetLeftTreeRevision() string { + if x != nil { + return x.LeftTreeRevision + } + return "" +} + +func (x *FindChangedPathsRequest_Request_TreeRequest) GetRightTreeRevision() string { + if x != nil { + return x.RightTreeRevision + } + return "" +} + +// CommitRequest compares a commit to its parents (or some other commits.) +type FindChangedPathsRequest_Request_CommitRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // commit_revision is the revision of the commit that should be compared. If no `parent_commit_revisions` + // are given, then the commit will be compared against its parents. The revision needs to peel to a + // commit object. + CommitRevision string `protobuf:"bytes,1,opt,name=commit_revision,json=commitRevision,proto3" json:"commit_revision,omitempty"` + // parent_commit_revisions are the revisions of commits to treat as the commit's parents. This is an + // optional field: if not specified, the actual parents of the commit referred to by `commit_revision` + // are used. + ParentCommitRevisions []string `protobuf:"bytes,2,rep,name=parent_commit_revisions,json=parentCommitRevisions,proto3" json:"parent_commit_revisions,omitempty"` +} + +func (x *FindChangedPathsRequest_Request_CommitRequest) Reset() { + *x = FindChangedPathsRequest_Request_CommitRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_diff_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindChangedPathsRequest_Request_CommitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindChangedPathsRequest_Request_CommitRequest) ProtoMessage() {} + +func (x *FindChangedPathsRequest_Request_CommitRequest) ProtoReflect() protoreflect.Message { + mi := &file_diff_proto_msgTypes[17] + 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 FindChangedPathsRequest_Request_CommitRequest.ProtoReflect.Descriptor instead. +func (*FindChangedPathsRequest_Request_CommitRequest) Descriptor() ([]byte, []int) { + return file_diff_proto_rawDescGZIP(), []int{12, 0, 1} +} + +func (x *FindChangedPathsRequest_Request_CommitRequest) GetCommitRevision() string { + if x != nil { + return x.CommitRevision + } + return "" +} + +func (x *FindChangedPathsRequest_Request_CommitRequest) GetParentCommitRevisions() []string { + if x != nil { + return x.ParentCommitRevisions + } + return nil +} + var File_diff_proto protoreflect.FileDescriptor var file_diff_proto_rawDesc = []byte{ @@ -1410,64 +1629,95 @@ var file_diff_proto_rawDesc = []byte{ 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x22, 0x6d, 0x0a, 0x17, 0x46, 0x69, - 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 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, - 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x46, 0x0a, 0x18, 0x46, 0x69, 0x6e, - 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 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, 0x22, 0xa4, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, - 0x68, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x33, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4b, 0x0a, 0x06, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x44, 0x45, 0x44, 0x10, 0x00, - 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, + 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x22, 0xe3, 0x04, 0x0a, 0x17, 0x46, + 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 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, 0x1c, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x43, + 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x27, 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, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x1a, 0xaa, 0x03, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x58, 0x0a, 0x0c, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 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, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x54, + 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x72, + 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x35, 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, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x6b, 0x0a, 0x0b, 0x54, 0x72, 0x65, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x65, 0x66, 0x74, + 0x5f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x65, 0x66, 0x74, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, + 0x74, 0x72, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x11, 0x72, 0x69, 0x67, 0x68, 0x74, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x70, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x36, 0x0a, 0x17, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, + 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x46, 0x0a, 0x18, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, + 0x61, 0x74, 0x68, 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, 0x22, 0xa4, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x33, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, + 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x61, + 0x74, 0x68, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x4b, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, 0x0a, 0x05, + 0x41, 0x44, 0x44, 0x45, 0x44, 0x10, 0x00, 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, 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, - 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, + 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, } var ( @@ -1483,56 +1733,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, 18) 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 + (*FindChangedPathsRequest_Request)(nil), // 17: gitaly.FindChangedPathsRequest.Request + (*FindChangedPathsRequest_Request_TreeRequest)(nil), // 18: gitaly.FindChangedPathsRequest.Request.TreeRequest + (*FindChangedPathsRequest_Request_CommitRequest)(nil), // 19: gitaly.FindChangedPathsRequest.Request.CommitRequest + (*Repository)(nil), // 20: gitaly.Repository } var file_diff_proto_depIdxs = []int32{ - 17, // 0: gitaly.CommitDiffRequest.repository:type_name -> gitaly.Repository + 20, // 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 + 20, // 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 + 20, // 4: gitaly.RawDiffRequest.repository:type_name -> gitaly.Repository + 20, // 5: gitaly.RawPatchRequest.repository:type_name -> gitaly.Repository + 20, // 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 - 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 + 20, // 8: gitaly.FindChangedPathsRequest.repository:type_name -> gitaly.Repository + 17, // 9: gitaly.FindChangedPathsRequest.requests:type_name -> gitaly.FindChangedPathsRequest.Request + 16, // 10: gitaly.FindChangedPathsResponse.paths:type_name -> gitaly.ChangedPaths + 1, // 11: gitaly.ChangedPaths.status:type_name -> gitaly.ChangedPaths.Status + 18, // 12: gitaly.FindChangedPathsRequest.Request.tree_request:type_name -> gitaly.FindChangedPathsRequest.Request.TreeRequest + 19, // 13: gitaly.FindChangedPathsRequest.Request.commit_request:type_name -> gitaly.FindChangedPathsRequest.Request.CommitRequest + 2, // 14: gitaly.DiffService.CommitDiff:input_type -> gitaly.CommitDiffRequest + 4, // 15: gitaly.DiffService.CommitDelta:input_type -> gitaly.CommitDeltaRequest + 7, // 16: gitaly.DiffService.RawDiff:input_type -> gitaly.RawDiffRequest + 9, // 17: gitaly.DiffService.RawPatch:input_type -> gitaly.RawPatchRequest + 11, // 18: gitaly.DiffService.DiffStats:input_type -> gitaly.DiffStatsRequest + 14, // 19: gitaly.DiffService.FindChangedPaths:input_type -> gitaly.FindChangedPathsRequest + 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 + 20, // [20:26] is the sub-list for method output_type + 14, // [14:20] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_diff_proto_init() } @@ -1723,6 +1979,46 @@ func file_diff_proto_init() { return nil } } + file_diff_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindChangedPathsRequest_Request); 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.(*FindChangedPathsRequest_Request_TreeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_diff_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindChangedPathsRequest_Request_CommitRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_diff_proto_msgTypes[15].OneofWrappers = []interface{}{ + (*FindChangedPathsRequest_Request_TreeRequest_)(nil), + (*FindChangedPathsRequest_Request_CommitRequest_)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -1730,7 +2026,7 @@ func file_diff_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_diff_proto_rawDesc, NumEnums: 2, - NumMessages: 15, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/ruby/proto/gitaly/diff_pb.rb b/ruby/proto/gitaly/diff_pb.rb index 5a805b038..980aa94e8 100644 --- a/ruby/proto/gitaly/diff_pb.rb +++ b/ruby/proto/gitaly/diff_pb.rb @@ -92,6 +92,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.FindChangedPathsRequest" do optional :repository, :message, 1, "gitaly.Repository" repeated :commits, :string, 2 + repeated :requests, :message, 3, "gitaly.FindChangedPathsRequest.Request" + end + add_message "gitaly.FindChangedPathsRequest.Request" do + oneof :type do + optional :tree_request, :message, 1, "gitaly.FindChangedPathsRequest.Request.TreeRequest" + optional :commit_request, :message, 2, "gitaly.FindChangedPathsRequest.Request.CommitRequest" + end + end + add_message "gitaly.FindChangedPathsRequest.Request.TreeRequest" do + optional :left_tree_revision, :string, 1 + optional :right_tree_revision, :string, 2 + end + add_message "gitaly.FindChangedPathsRequest.Request.CommitRequest" do + optional :commit_revision, :string, 1 + repeated :parent_commit_revisions, :string, 2 end add_message "gitaly.FindChangedPathsResponse" do repeated :paths, :message, 1, "gitaly.ChangedPaths" @@ -125,6 +140,9 @@ module Gitaly DiffStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.DiffStats").msgclass DiffStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.DiffStatsResponse").msgclass FindChangedPathsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindChangedPathsRequest").msgclass + FindChangedPathsRequest::Request = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindChangedPathsRequest.Request").msgclass + FindChangedPathsRequest::Request::TreeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindChangedPathsRequest.Request.TreeRequest").msgclass + FindChangedPathsRequest::Request::CommitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.FindChangedPathsRequest.Request.CommitRequest").msgclass 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 |