diff --git a/changelogs/unreleased/16950_add_word_diff_mode.yml b/changelogs/unreleased/16950_add_word_diff_mode.yml new file mode 100644 index 0000000000000000000000000000000000000000..2373ca1e40622aa48d8ddcffebd7ba8de3e7c234 --- /dev/null +++ b/changelogs/unreleased/16950_add_word_diff_mode.yml @@ -0,0 +1,5 @@ +--- +title: Add support for word-diff mode +merge_request: 3086 +author: +type: added diff --git a/internal/gitaly/diff/diff.go b/internal/gitaly/diff/diff.go index c9def4228351e2dec2dba9c6bfb575910fde953a..65f179f0ed7029d78fa8cc24ab29febbd56fb5cd 100644 --- a/internal/gitaly/diff/diff.go +++ b/internal/gitaly/diff/diff.go @@ -156,6 +156,8 @@ func (parser *Parser) Parse() bool { parser.consumeChunkLine(false) } else if helper.ByteSliceHasAnyPrefix(line, "---", "+++") && !parser.isParsingChunkLines() { parser.consumeLine(false) + } else if bytes.HasPrefix(line, []byte("~\n")) { + parser.consumeChunkLine(true) } else if helper.ByteSliceHasAnyPrefix(line, "-", "+", " ", "\\", "Binary") { parser.consumeChunkLine(true) } else { diff --git a/internal/gitaly/diff/diff_test.go b/internal/gitaly/diff/diff_test.go index 17f24bfc5e92be4d38ddb13d83fdbb92bc509a8c..4cc919d5c6e1d62981c6f9436e197a8f03abeb17 100644 --- a/internal/gitaly/diff/diff_test.go +++ b/internal/gitaly/diff/diff_test.go @@ -71,6 +71,54 @@ index 0000000000000000000000000000000000000000..3be11c69355948412925fa5e073d76d5 require.Equal(t, expectedDiffs, diffs) } +func TestDiffParserWithWordDiff(t *testing.T) { + rawDiff := `:000000 100644 0000000000000000000000000000000000000000 4cc7061661b8f52891bc1b39feb4d856b21a1067 A big.txt + +diff --git a/big.txt b/big.txt +new file mode 100644 +index 000000000..3a62d28e3 +--- /dev/null ++++ b/big.txt +@@ -0,0 +1,3 @@ ++A +~ ++B +~ignoreme ++C +~ +` + + limits := Limits{ + EnforceLimits: true, + SafeMaxFiles: 3, + SafeMaxBytes: 200, + SafeMaxLines: 200, + MaxFiles: 5, + MaxBytes: 10000000, + MaxLines: 10000000, + MaxPatchBytes: 100000, + CollapseDiffs: false, + } + diffs := getDiffs(rawDiff, limits) + + expectedDiffs := []*Diff{ + &Diff{ + OldMode: 0, + NewMode: 0100644, + FromID: "0000000000000000000000000000000000000000", + ToID: "4cc7061661b8f52891bc1b39feb4d856b21a1067", + FromPath: []byte("big.txt"), + ToPath: []byte("big.txt"), + Status: 'A', + Collapsed: false, + Patch: []byte("@@ -0,0 +1,3 @@\n+A\n~\n+B\n+C\n~\n"), + lineCount: 4, + }, + } + + require.Equal(t, expectedDiffs, diffs) +} + func TestDiffParserWithLargeDiffWithFalseCollapseDiffsFlag(t *testing.T) { bigPatch := strings.Repeat("+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n", 100000) rawDiff := fmt.Sprintf(`:000000 100644 0000000000000000000000000000000000000000 4cc7061661b8f52891bc1b39feb4d856b21a1067 A big.txt @@ -291,7 +339,6 @@ func TestDiffLimitsBeingEnforcedByUpperBound(t *testing.T) { MaxLines: 0, MaxPatchBytes: 0, } - diffParser := NewDiffParser(strings.NewReader(""), limits) require.Equal(t, diffParser.limits.SafeMaxBytes, safeMaxBytesUpperBound) diff --git a/internal/gitaly/service/diff/commit.go b/internal/gitaly/service/diff/commit.go index 8824f6c040119a99a0933dcd425247ef57440bed..7f940ef9013f282aae4b40559233054fd3b28218 100644 --- a/internal/gitaly/service/diff/commit.go +++ b/internal/gitaly/service/diff/commit.go @@ -50,6 +50,9 @@ func (s *server) CommitDiff(in *gitalypb.CommitDiffRequest, stream gitalypb.Diff if ignoreWhitespaceChange { cmd.Flags = append(cmd.Flags, git.Flag{Name: "--ignore-space-change"}) } + if in.GetDiffMode() == gitalypb.CommitDiffRequest_WORDDIFF { + cmd.Flags = append(cmd.Flags, git.Flag{Name: "--word-diff=porcelain"}) + } if len(paths) > 0 { for _, path := range paths { cmd.PostSepArgs = append(cmd.PostSepArgs, string(path)) diff --git a/internal/gitaly/service/diff/commit_test.go b/internal/gitaly/service/diff/commit_test.go index 502814029dee5551156fc67c30c0fc228485d90e..6b9a4467a161e2e6a477b052276505892c22f30c 100644 --- a/internal/gitaly/service/diff/commit_test.go +++ b/internal/gitaly/service/diff/commit_test.go @@ -1,6 +1,7 @@ package diff import ( + "bytes" "fmt" "io" "testing" @@ -397,6 +398,193 @@ func TestSuccessfulCommitDiffRequestWithIgnoreWhitespaceChange(t *testing.T) { } } +func TestSuccessfulCommitDiffRequestWithWordDiff(t *testing.T) { + _, repo, repoPath, client := setupDiffService(t) + + rightCommit := "ab2c9622c02288a2bbaaf35d96088cfdff31d9d9" + leftCommit := "8a0f2ee90d940bfb0ba1e14e8214b0649056e4ab" + + var diffPatches [][]byte + output := testhelper.MustRunCommand(t, nil, "git", "-C", repoPath, "diff", "--word-diff=porcelain", leftCommit, rightCommit) + diffPerFile := bytes.Split(output, []byte("diff --git")) + + for _, s := range diffPerFile { + if idx := bytes.Index(s, []byte("@@")); idx != -1 { + diffPatches = append(diffPatches, s[idx:]) + } + } + + expectedDiffs := []diff.Diff{ + { + FromID: "faaf198af3a36dbf41961466703cc1d47c61d051", + ToID: "877cee6ab11f9094e1bcdb7f1fd9c0001b572185", + OldMode: 0100644, + NewMode: 0100644, + FromPath: []byte("README.md"), + ToPath: []byte("README.md"), + Binary: false, + Patch: diffPatches[0], + }, + { + FromID: "bdea48ee65c869eb0b86b1283069d76cce0a7254", + ToID: "0000000000000000000000000000000000000000", + OldMode: 0100644, + NewMode: 0, + FromPath: []byte("gitaly/deleted-file"), + ToPath: []byte("gitaly/deleted-file"), + Binary: false, + Patch: diffPatches[1], + }, + { + FromID: "aa408b4556e594f7974390ad6b86210617fbda6e", + ToID: "1c69c4d2a65ad05c24ac3b6780b5748b97ffd3aa", + OldMode: 0100644, + NewMode: 0100644, + FromPath: []byte("gitaly/file-with-multiple-chunks"), + ToPath: []byte("gitaly/file-with-multiple-chunks"), + Binary: false, + Patch: diffPatches[2], + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "389c7a36a6e133268b0d36b00e7ffc0f3a5b6651", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/file-with-pluses.txt"), + ToPath: []byte("gitaly/file-with-pluses.txt"), + Binary: false, + Patch: diffPatches[3], + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "bc2ef601a538d69ef99d5bdafa605e63f902e8e4", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/logo-white.png"), + ToPath: []byte("gitaly/logo-white.png"), + Binary: true, + Patch: []byte("Binary files /dev/null and b/gitaly/logo-white.png differ\n"), + }, + { + FromID: "ead5a0eee1391308803cfebd8a2a8530495645eb", + ToID: "ead5a0eee1391308803cfebd8a2a8530495645eb", + OldMode: 0100644, + NewMode: 0100755, + FromPath: []byte("gitaly/mode-file"), + ToPath: []byte("gitaly/mode-file"), + Binary: false, + }, + { + FromID: "357406f3075a57708d0163752905cc1576fceacc", + ToID: "8e5177d718c561d36efde08bad36b43687ee6bf0", + OldMode: 0100644, + NewMode: 0100755, + FromPath: []byte("gitaly/mode-file-with-mods"), + ToPath: []byte("gitaly/mode-file-with-mods"), + Binary: false, + Patch: diffPatches[4], + }, + { + FromID: "43d24af4e22580f36b1ca52647c1aff75a766a33", + ToID: "0000000000000000000000000000000000000000", + OldMode: 0100644, + NewMode: 0, + FromPath: []byte("gitaly/named-file-with-mods"), + ToPath: []byte("gitaly/named-file-with-mods"), + Binary: false, + Patch: diffPatches[5], + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "b464dff7a75ccc92fbd920fd9ae66a84b9d2bf94", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/no-newline-at-the-end"), + ToPath: []byte("gitaly/no-newline-at-the-end"), + Binary: false, + Patch: diffPatches[6], + }, + { + FromID: "4e76e90b3c7e52390de9311a23c0a77575aed8a8", + ToID: "4e76e90b3c7e52390de9311a23c0a77575aed8a8", + OldMode: 0100644, + NewMode: 0100644, + FromPath: []byte("gitaly/named-file"), + ToPath: []byte("gitaly/renamed-file"), + Binary: false, + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "3856c00e9450a51a62096327167fc43d3be62eef", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/renamed-file-with-mods"), + ToPath: []byte("gitaly/renamed-file-with-mods"), + Binary: false, + Patch: diffPatches[7], + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "a135e3e0d4af177a902ca57dcc4c7fc6f30858b1", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("gitaly/tab\tnewline\n file"), + ToPath: []byte("gitaly/tab\tnewline\n file"), + Binary: false, + Patch: diffPatches[8], + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", + OldMode: 0, + NewMode: 0100755, + FromPath: []byte("gitaly/テスト.txt"), + ToPath: []byte("gitaly/テスト.txt"), + Binary: false, + }, + { + FromID: "0000000000000000000000000000000000000000", + ToID: "b1e67221afe8461efd244b487afca22d46b95eb8", + OldMode: 0, + NewMode: 0100644, + FromPath: []byte("z-short-diff"), + ToPath: []byte("z-short-diff"), + Binary: false, + Patch: diffPatches[9], + }, + } + + testCases := []struct { + noPrefixConfig string + desc string + }{ + {noPrefixConfig: "false", desc: "Git config diff.noprefix set to false"}, + {noPrefixConfig: "true", desc: "Git config diff.noprefix set to true"}, + } + + for _, testCase := range testCases { + t.Run(testCase.desc, func(t *testing.T) { + testhelper.MustRunCommand(t, nil, "git", "-C", repoPath, "config", "diff.noprefix", testCase.noPrefixConfig) + rpcRequest := &gitalypb.CommitDiffRequest{ + Repository: repo, + RightCommitId: rightCommit, + LeftCommitId: leftCommit, + IgnoreWhitespaceChange: false, + DiffMode: gitalypb.CommitDiffRequest_WORDDIFF, + } + + ctx, cancel := testhelper.Context() + defer cancel() + c, err := client.CommitDiff(ctx, rpcRequest) + if err != nil { + t.Fatal(err) + } + + assertExactReceivedDiffs(t, c, expectedDiffs) + }) + } +} + func TestSuccessfulCommitDiffRequestWithLimits(t *testing.T) { _, repo, _, client := setupDiffService(t) diff --git a/proto/diff.proto b/proto/diff.proto index b7199fb2366d2421965b3c37864025c9d91bebe7..e3c22b52801765ee0c939fe2b9ea695b406608ab 100644 --- a/proto/diff.proto +++ b/proto/diff.proto @@ -44,6 +44,13 @@ service DiffService { } message CommitDiffRequest { + enum DiffMode { + // DEFAULT is the standard diff mode and results in a linewise diff for textfiles. + DEFAULT = 0; + // WORDDIFF is a word diff and computes the diff for whitespace separated words instead of for whole lines. + WORDDIFF = 1; + } + Repository repository = 1 [(target_repository)=true]; string left_commit_id = 2; string right_commit_id = 3; @@ -65,6 +72,9 @@ message CommitDiffRequest { int32 safe_max_files = 11; int32 safe_max_lines = 12; int32 safe_max_bytes = 13; + + // DiffMode is the mode used for generating the diff. Please refer to the enum declaration for supported modes. + DiffMode diff_mode = 15; } // A CommitDiffResponse corresponds to a single changed file in a commit. @@ -176,4 +186,3 @@ message ChangedPaths { bytes path = 1; Status status = 2; } - diff --git a/proto/go/gitalypb/diff.pb.go b/proto/go/gitalypb/diff.pb.go index 0b0d0f294fef8ed88b0c3308f82271945ffae303..75f92a31a7fa2db8e750ba59ae449006b1a1e8ed 100644 --- a/proto/go/gitalypb/diff.pb.go +++ b/proto/go/gitalypb/diff.pb.go @@ -24,6 +24,33 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +type CommitDiffRequest_DiffMode int32 + +const ( + // DEFAULT is the standard diff mode and results in a linewise diff for textfiles. + CommitDiffRequest_DEFAULT CommitDiffRequest_DiffMode = 0 + // WORDDIFF is a word diff and computes the diff for whitespace separated words instead of for whole lines. + CommitDiffRequest_WORDDIFF CommitDiffRequest_DiffMode = 1 +) + +var CommitDiffRequest_DiffMode_name = map[int32]string{ + 0: "DEFAULT", + 1: "WORDDIFF", +} + +var CommitDiffRequest_DiffMode_value = map[string]int32{ + "DEFAULT": 0, + "WORDDIFF": 1, +} + +func (x CommitDiffRequest_DiffMode) String() string { + return proto.EnumName(CommitDiffRequest_DiffMode_name, int32(x)) +} + +func (CommitDiffRequest_DiffMode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_686521effc814b25, []int{0, 0} +} + type ChangedPaths_Status int32 const ( @@ -75,12 +102,14 @@ type CommitDiffRequest struct { // If this is 0 you will get back empty patches. MaxPatchBytes int32 `protobuf:"varint,14,opt,name=max_patch_bytes,json=maxPatchBytes,proto3" json:"max_patch_bytes,omitempty"` // These limits are only enforced if collapse_diffs == true. - SafeMaxFiles int32 `protobuf:"varint,11,opt,name=safe_max_files,json=safeMaxFiles,proto3" json:"safe_max_files,omitempty"` - SafeMaxLines int32 `protobuf:"varint,12,opt,name=safe_max_lines,json=safeMaxLines,proto3" json:"safe_max_lines,omitempty"` - SafeMaxBytes int32 `protobuf:"varint,13,opt,name=safe_max_bytes,json=safeMaxBytes,proto3" json:"safe_max_bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SafeMaxFiles int32 `protobuf:"varint,11,opt,name=safe_max_files,json=safeMaxFiles,proto3" json:"safe_max_files,omitempty"` + SafeMaxLines int32 `protobuf:"varint,12,opt,name=safe_max_lines,json=safeMaxLines,proto3" json:"safe_max_lines,omitempty"` + SafeMaxBytes int32 `protobuf:"varint,13,opt,name=safe_max_bytes,json=safeMaxBytes,proto3" json:"safe_max_bytes,omitempty"` + // DiffMode is the mode used for generating the diff. Please refer to the enum declaration for supported modes. + DiffMode CommitDiffRequest_DiffMode `protobuf:"varint,15,opt,name=diff_mode,json=diffMode,proto3,enum=gitaly.CommitDiffRequest_DiffMode" json:"diff_mode,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CommitDiffRequest) Reset() { *m = CommitDiffRequest{} } @@ -206,6 +235,13 @@ func (m *CommitDiffRequest) GetSafeMaxBytes() int32 { return 0 } +func (m *CommitDiffRequest) GetDiffMode() CommitDiffRequest_DiffMode { + if m != nil { + return m.DiffMode + } + return CommitDiffRequest_DEFAULT +} + // A CommitDiffResponse corresponds to a single changed file in a commit. type CommitDiffResponse struct { FromPath []byte `protobuf:"bytes,1,opt,name=from_path,json=fromPath,proto3" json:"from_path,omitempty"` @@ -1007,6 +1043,7 @@ func (m *ChangedPaths) GetStatus() ChangedPaths_Status { } func init() { + proto.RegisterEnum("gitaly.CommitDiffRequest_DiffMode", CommitDiffRequest_DiffMode_name, CommitDiffRequest_DiffMode_value) proto.RegisterEnum("gitaly.ChangedPaths_Status", ChangedPaths_Status_name, ChangedPaths_Status_value) proto.RegisterType((*CommitDiffRequest)(nil), "gitaly.CommitDiffRequest") proto.RegisterType((*CommitDiffResponse)(nil), "gitaly.CommitDiffResponse") @@ -1028,72 +1065,76 @@ func init() { func init() { proto.RegisterFile("diff.proto", fileDescriptor_686521effc814b25) } var fileDescriptor_686521effc814b25 = []byte{ - // 1040 bytes of a gzipped FileDescriptorProto + // 1091 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x2e, 0x25, 0x8a, 0xa2, 0x46, 0xb4, 0xac, 0xac, 0x03, 0x9b, 0x96, 0x0b, 0x54, 0x20, 0xf2, - 0x23, 0xf4, 0x47, 0x0e, 0x9c, 0x4b, 0x0e, 0xbd, 0xc4, 0xa6, 0x9c, 0x2a, 0xb5, 0x6a, 0x81, 0x09, - 0x50, 0xb4, 0x17, 0x62, 0x25, 0x2e, 0x25, 0xa2, 0x24, 0x57, 0x25, 0x37, 0x96, 0xfd, 0x24, 0x4d, - 0x7b, 0x2e, 0x50, 0xa0, 0xc7, 0x3e, 0x44, 0x1f, 0xa6, 0x4f, 0x50, 0xf4, 0x54, 0xec, 0x2e, 0x49, - 0x51, 0x96, 0xd2, 0x53, 0x0f, 0xba, 0x71, 0xbe, 0xef, 0xf3, 0xec, 0xec, 0xb7, 0x33, 0x23, 0x03, - 0x78, 0x81, 0xef, 0xf7, 0x17, 0x09, 0x65, 0x14, 0x69, 0xb3, 0x80, 0xe1, 0xf0, 0xae, 0x03, 0x61, - 0x10, 0x33, 0x89, 0x75, 0x8c, 0x74, 0x8e, 0x13, 0xe2, 0xc9, 0xc8, 0xfa, 0x5d, 0x85, 0x07, 0x17, - 0x34, 0x8a, 0x02, 0x66, 0x07, 0xbe, 0xef, 0x90, 0x1f, 0xdf, 0x91, 0x94, 0xa1, 0x17, 0x00, 0x09, - 0x59, 0xd0, 0x34, 0x60, 0x34, 0xb9, 0x33, 0x95, 0xae, 0xd2, 0x6b, 0x9e, 0xa1, 0xbe, 0x4c, 0xd6, - 0x77, 0x0a, 0xe6, 0x5c, 0x7d, 0xff, 0xe7, 0xe7, 0x8a, 0x53, 0xd2, 0xa2, 0x47, 0xd0, 0x0a, 0x89, - 0xcf, 0xdc, 0xa9, 0xc8, 0xe9, 0x06, 0x9e, 0x59, 0xe9, 0x2a, 0xbd, 0x86, 0x63, 0x70, 0x54, 0x1e, - 0x34, 0xf4, 0xd0, 0x13, 0xd8, 0x4f, 0x82, 0xd9, 0xbc, 0x2c, 0xab, 0x0a, 0xd9, 0x9e, 0x80, 0x0b, - 0xdd, 0x0b, 0x30, 0x83, 0x59, 0x4c, 0x13, 0xe2, 0x2e, 0xe7, 0x01, 0x23, 0xe9, 0x02, 0x4f, 0x89, - 0x3b, 0x9d, 0xe3, 0x78, 0x46, 0x4c, 0xb5, 0xab, 0xf4, 0x74, 0xe7, 0x50, 0xf2, 0xdf, 0x16, 0xf4, - 0x85, 0x60, 0xd1, 0x43, 0xa8, 0x2d, 0x30, 0x9b, 0xa7, 0x66, 0xad, 0x5b, 0xed, 0x19, 0x8e, 0x0c, - 0xd0, 0x63, 0x68, 0x4d, 0x69, 0x18, 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e1, 0xb1, + 0xfc, 0xfc, 0x8c, 0xc6, 0x93, 0x63, 0x99, 0xe2, 0x58, 0xfc, 0xf9, 0x3f, 0x9e, 0xd0, 0x34, 0x9e, + 0x8d, 0x46, 0xaa, 0x80, 0x5e, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x44, 0xf3, 0x8d, 0x8e, 0x3f, + 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/ruby/proto/gitaly/diff_pb.rb b/ruby/proto/gitaly/diff_pb.rb index 8baa2817fe95cb86966ae8536184bc24478313dd..877589823af8dfda4be0e3067c262468a7807dc9 100644 --- a/ruby/proto/gitaly/diff_pb.rb +++ b/ruby/proto/gitaly/diff_pb.rb @@ -22,6 +22,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :safe_max_files, :int32, 11 optional :safe_max_lines, :int32, 12 optional :safe_max_bytes, :int32, 13 + optional :diff_mode, :enum, 15, "gitaly.CommitDiffRequest.DiffMode" + end + add_enum "gitaly.CommitDiffRequest.DiffMode" do + value :DEFAULT, 0 + value :WORDDIFF, 1 end add_message "gitaly.CommitDiffResponse" do optional :from_path, :bytes, 1 @@ -107,6 +112,7 @@ end module Gitaly CommitDiffRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitDiffRequest").msgclass + CommitDiffRequest::DiffMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitDiffRequest.DiffMode").enummodule CommitDiffResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitDiffResponse").msgclass CommitDeltaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitDeltaRequest").msgclass CommitDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CommitDelta").msgclass