From 11e5febeee7aae1943f054e323cbb6420c458e99 Mon Sep 17 00:00:00 2001 From: Richard Gomez <32133502+rgmz@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:58:45 -0400 Subject: [PATCH] feat(git): scan commit metadata (#2754) This is a follow-up to #2713 that fixes the strange test error. As suspected, the failure was caused by additional diffs not being included in the test's expected data. --- pkg/gitparse/gitparse.go | 137 +++++++-- pkg/gitparse/gitparse_test.go | 512 +++++++++++++++++++++++----------- pkg/sources/git/git.go | 38 ++- pkg/sources/git/git_test.go | 13 + 4 files changed, 514 insertions(+), 186 deletions(-) diff --git a/pkg/gitparse/gitparse.go b/pkg/gitparse/gitparse.go index 94d3fb80f1b1..e1db17f641d1 100644 --- a/pkg/gitparse/gitparse.go +++ b/pkg/gitparse/gitparse.go @@ -22,7 +22,7 @@ import ( const ( // defaultDateFormat is the standard date format for git. - defaultDateFormat = "Mon Jan 02 15:04:05 2006 -0700" + defaultDateFormat = "Mon Jan 2 15:04:05 2006 -0700" // defaultMaxDiffSize is the maximum size for a diff. Larger diffs will be cut off. defaultMaxDiffSize = 2 * 1024 * 1024 * 1024 // 2GB @@ -108,11 +108,12 @@ func (d *Diff) finalize() error { return d.contentWriter.CloseForWriting() } // Commit contains commit header info and diffs. type Commit struct { - Hash string - Author string - Date time.Time - Message strings.Builder - Size int // in bytes + Hash string + Author string + Committer string + Date time.Time + Message strings.Builder + Size int // in bytes hasDiffs bool } @@ -133,10 +134,15 @@ const ( CommitLine MergeLine AuthorLine - DateLine + AuthorDateLine + CommitterLine + CommitterDateLine MessageStartLine MessageLine MessageEndLine + NotesStartLine + NotesLine + NotesEndLine DiffLine ModeLine IndexLine @@ -154,10 +160,15 @@ func (state ParseState) String() string { "CommitLine", "MergeLine", "AuthorLine", - "DateLine", + "AuthorDateLine", + "CommitterLine", + "CommitterDateLine", "MessageStartLine", "MessageLine", "MessageEndLine", + "NotesStartLine", + "NotesLine", + "NotesEndLine", "DiffLine", "ModeLine", "IndexLine", @@ -211,7 +222,15 @@ func NewParser(options ...Option) *Parser { // RepoPath parses the output of the `git log` command for the `source` path. // The Diff chan will return diffs in the order they are parsed from the log. func (c *Parser) RepoPath(ctx context.Context, source string, head string, abbreviatedLog bool, excludedGlobs []string, isBare bool) (chan *Diff, error) { - args := []string{"-C", source, "log", "-p", "--full-history", "--date=format:%a %b %d %H:%M:%S %Y %z"} + args := []string{ + "-C", source, + "log", + "--patch", // https://git-scm.com/docs/git-log#Documentation/git-log.txt---patch + "--full-history", + "--date=format:%a %b %d %H:%M:%S %Y %z", + "--pretty=fuller", // https://git-scm.com/docs/git-log#_pretty_formats + "--notes", // https://git-scm.com/docs/git-log#Documentation/git-log.txt---notesltrefgt + } if abbreviatedLog { args = append(args, "--diff-filter=AM") } @@ -375,16 +394,23 @@ func (c *Parser) FromReader(ctx context.Context, stdOut io.Reader, diffChan chan latestState = MergeLine case isAuthorLine(isStaged, latestState, line): latestState = AuthorLine - currentCommit.Author = strings.TrimRight(string(line[8:]), "\n") - - case isDateLine(isStaged, latestState, line): - latestState = DateLine + currentCommit.Author = strings.TrimSpace(string(line[8:])) + case isAuthorDateLine(isStaged, latestState, line): + latestState = AuthorDateLine - date, err := time.Parse(c.dateFormat, strings.TrimSpace(string(line[6:]))) + date, err := time.Parse(c.dateFormat, strings.TrimSpace(string(line[12:]))) if err != nil { - ctx.Logger().V(2).Info("Could not parse date from git stream.", "error", err) + ctx.Logger().Error(err, "failed to parse commit date", "commit", currentCommit.Hash, "latestState", latestState.String()) + latestState = ParseFailure + continue } currentCommit.Date = date + case isCommitterLine(isStaged, latestState, line): + latestState = CommitterLine + currentCommit.Committer = strings.TrimSpace(string(line[8:])) + case isCommitterDateLine(isStaged, latestState, line): + latestState = CommitterDateLine + // NoOp case isMessageStartLine(isStaged, latestState, line): latestState = MessageStartLine // NoOp @@ -395,6 +421,17 @@ func (c *Parser) FromReader(ctx context.Context, stdOut io.Reader, diffChan chan case isMessageEndLine(isStaged, latestState, line): latestState = MessageEndLine // NoOp + case isNotesStartLine(isStaged, latestState, line): + latestState = NotesStartLine + + currentCommit.Message.WriteString("\n") + currentCommit.Message.Write(line) + case isNotesLine(isStaged, latestState, line): + latestState = NotesLine + currentCommit.Message.Write(line[4:]) // Notes are indented by 4 spaces. + case isNotesEndLine(isStaged, latestState, line): + latestState = NotesEndLine + // NoOp case isDiffLine(isStaged, latestState, line): latestState = DiffLine @@ -579,20 +616,42 @@ func isAuthorLine(isStaged bool, latestState ParseState, line []byte) bool { return false } -// Date: Tue Aug 10 15:20:40 2021 +0100 -func isDateLine(isStaged bool, latestState ParseState, line []byte) bool { +// AuthorDate: Tue Aug 10 15:20:40 2021 +0100 +func isAuthorDateLine(isStaged bool, latestState ParseState, line []byte) bool { if isStaged || latestState != AuthorLine { return false } - if len(line) > 7 && bytes.Equal(line[:5], []byte("Date:")) { + if len(line) > 10 && bytes.Equal(line[:11], []byte("AuthorDate:")) { + return true + } + return false +} + +// Commit: Bill Rich +func isCommitterLine(isStaged bool, latestState ParseState, line []byte) bool { + if isStaged || latestState != AuthorDateLine { + return false + } + if len(line) > 8 && bytes.Equal(line[:7], []byte("Commit:")) { return true } return false } -// Line directly after Date with only a newline. +// CommitDate: Wed Apr 17 19:59:28 2024 -0400 +func isCommitterDateLine(isStaged bool, latestState ParseState, line []byte) bool { + if isStaged || latestState != CommitterLine { + return false + } + if len(line) > 10 && bytes.Equal(line[:11], []byte("CommitDate:")) { + return true + } + return false +} + +// Line directly after CommitterDate with only a newline. func isMessageStartLine(isStaged bool, latestState ParseState, line []byte) bool { - if isStaged || latestState != DateLine { + if isStaged || latestState != CommitterDateLine { return false } // TODO: Improve the implementation of this and isMessageEndLine @@ -624,15 +683,51 @@ func isMessageEndLine(isStaged bool, latestState ParseState, line []byte) bool { return false } +// `Notes:` or `Notes (context):` +// See https://tylercipriani.com/blog/2022/11/19/git-notes-gits-coolest-most-unloved-feature/ +func isNotesStartLine(isStaged bool, latestState ParseState, line []byte) bool { + if isStaged || latestState != MessageEndLine { + return false + } + if len(line) > 5 && bytes.Equal(line[:5], []byte("Notes")) { + return true + } + return false +} + +// Line after NotesStartLine that starts with 4 spaces +func isNotesLine(isStaged bool, latestState ParseState, line []byte) bool { + if isStaged || !(latestState == NotesStartLine || latestState == NotesLine) { + return false + } + if len(line) > 4 && bytes.Equal(line[:4], []byte(" ")) { + return true + } + return false +} + +// Line directly after NotesLine with only a newline. +func isNotesEndLine(isStaged bool, latestState ParseState, line []byte) bool { + if isStaged || latestState != NotesLine { + return false + } + if len(strings.TrimRight(string(line[:]), "\r\n")) == 0 { + return true + } + return false +} + // diff --git a/internal/addrs/move_endpoint_module.go b/internal/addrs/move_endpoint_module.go func isDiffLine(isStaged bool, latestState ParseState, line []byte) bool { if !(latestState == MessageStartLine || // Empty commit messages can go from MessageStart->Diff latestState == MessageEndLine || + latestState == NotesEndLine || latestState == BinaryFileLine || + latestState == ModeLine || latestState == IndexLine || latestState == HunkContentLine || latestState == ParseFailure) { - if latestState == Initial && !isStaged { + if !(isStaged && latestState == Initial) { return false } } diff --git a/pkg/gitparse/gitparse_test.go b/pkg/gitparse/gitparse_test.go index 3628f4741437..f5ca0d57961e 100644 --- a/pkg/gitparse/gitparse_test.go +++ b/pkg/gitparse/gitparse_test.go @@ -78,7 +78,7 @@ func TestLineChecksWithStaged(t *testing.T) { }, fails: []testCaseLine{ { - DateLine, + CommitterDateLine, []byte(" Merge pull request #34511 from cescoffier/duplicated-context-doc"), }, { @@ -111,16 +111,16 @@ func TestLineChecksWithStaged(t *testing.T) { }, function: isAuthorLine, }, - "dateLine": { + "authorDateLine": { passes: []testCaseLine{ { AuthorLine, - []byte("Date: Tue Jan 18 16:59:18 2022 -0800"), + []byte("AuthorDate: Tue Jan 18 16:59:18 2022 -0800"), }, }, fails: []testCaseLine{ { - DateLine, + AuthorDateLine, []byte(""), }, { @@ -128,12 +128,54 @@ func TestLineChecksWithStaged(t *testing.T) { []byte("notcorrect"), }, }, - function: isDateLine, + function: isAuthorDateLine, + }, + "committerLine": { + passes: []testCaseLine{ + { + AuthorDateLine, + []byte("Commit: Zachary Rice "), + }, + { + AuthorDateLine, + []byte("Commit: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>"), + }, + }, + fails: []testCaseLine{ + { + CommitLine, + []byte("Date: Tue Jun 20 13:55:31 2023 -0500"), + }, + { + AuthorLine, + []byte("Author: Bill Rich "), + }, + }, + function: isCommitterLine, + }, + "committerDateLine": { + passes: []testCaseLine{ + { + CommitterLine, + []byte("CommitDate: Tue Jan 18 16:59:18 2022 -0800"), + }, + }, + fails: []testCaseLine{ + { + CommitterDateLine, + []byte(""), + }, + { + CommitterLine, + []byte("notcorrect"), + }, + }, + function: isCommitterDateLine, }, "messageStartLine": { passes: []testCaseLine{ { - DateLine, + CommitterDateLine, []byte(""), }, }, @@ -143,7 +185,7 @@ func TestLineChecksWithStaged(t *testing.T) { []byte("Date: Tue Jun 20 13:21:19 2023 -0700"), }, { - DateLine, + CommitterDateLine, []byte("notcorrect"), }, }, @@ -166,7 +208,7 @@ func TestLineChecksWithStaged(t *testing.T) { []byte("Date: Tue Jun 20 13:21:19 2023 -0700"), }, { - DateLine, + CommitterDateLine, []byte("notcorrect"), }, }, @@ -191,6 +233,67 @@ func TestLineChecksWithStaged(t *testing.T) { }, function: isMessageEndLine, }, + "notesStartLine": { + passes: []testCaseLine{ + { + MessageEndLine, + []byte("Notes:"), + }, + { + MessageEndLine, + []byte("Notes (review):"), + }, + }, + fails: []testCaseLine{ + { + MessageStartLine, + []byte(""), + }, + { + MessageEndLine, + []byte("notcorrect"), + }, + }, + function: isNotesStartLine, + }, + "notesLine": { + passes: []testCaseLine{ + { + NotesStartLine, + []byte(" Submitted-by: Random J Developer "), + }, + }, + fails: []testCaseLine{ + { + MessageEndLine, + []byte(""), + }, + { + MessageEndLine, + []byte("notcorrect"), + }, + }, + function: isNotesLine, + }, + "notesEndLine": { + passes: []testCaseLine{ + { + NotesLine, + []byte("\n"), + }, + }, + fails: []testCaseLine{ + { + MessageEndLine, + []byte("\n"), + }, + { + NotesLine, + []byte("notcorrect"), + }, + }, + function: isNotesEndLine, + }, "diffLine": { passes: []testCaseLine{ { @@ -201,6 +304,10 @@ func TestLineChecksWithStaged(t *testing.T) { MessageEndLine, []byte("diff --git a/ Lunch and Learn - HCDiag.pdf b/ Lunch and Learn - HCDiag.pdf"), }, + { + NotesEndLine, + []byte("diff --git \"a/one.txt\" \"b/one.txt\""), + }, { BinaryFileLine, []byte("diff --git a/pkg/decoders/utf16_test.go b/pkg/decoders/utf16_test.go"), @@ -209,16 +316,24 @@ func TestLineChecksWithStaged(t *testing.T) { HunkContentLine, []byte("diff --git a/pkg/decoders/utf8.go b/pkg/decoders/utf8.go"), }, + { + ModeLine, + []byte("diff --git a/pkg/decoders/utf8.go b/pkg/decoders/utf8.go"), + }, }, fails: []testCaseLine{ { - DateLine, + CommitterDateLine, []byte(" Make trace error message so newlines aren't escaped (#1396)"), }, { MessageLine, []byte("notcorrect"), }, + { + NotesLine, + []byte("diff --git a/pkg/decoders/utf8.go b/pkg/decoders/utf8.go"), + }, }, function: isDiffLine, }, @@ -931,30 +1046,33 @@ func TestCommitParseFailureRecovery(t *testing.T) { PathB: ".travis.yml", LineStart: 1, Commit: &Commit{ - Hash: "df393b4125c2aa217211b2429b8963d0cefcee27", - Author: "Stephen ", - Date: newTime("Wed Dec 06 14:44:41 2017 -0800"), - Message: newStringBuilderValue("Add travis testing\n"), + Hash: "df393b4125c2aa217211b2429b8963d0cefcee27", + Author: "Stephen ", + Committer: "Stephen ", + Date: newTime("Wed Dec 06 14:44:41 2017 -0800"), + Message: newStringBuilderValue("Add travis testing\n"), }, contentWriter: newBufferWithContent([]byte("language: python\npython:\n - \"2.6\"\n - \"2.7\"\n - \"3.2\"\n - \"3.3\"\n - \"3.4\"\n - \"3.5\"\n - \"3.5-dev\" # 3.5 development branch\n - \"3.6\"\n - \"3.6-dev\" # 3.6 development branch\n - \"3.7-dev\" # 3.7 development branch\n - \"nightly\"\n")), IsBinary: false, }, { Commit: &Commit{ - Hash: "3d76a97faad96e0f326afb61c232b9c2a18dca35", - Author: "John Smith ", - Date: newTime("Tue Jul 11 18:03:54 2023 -0400"), - Message: strings.Builder{}, + Hash: "3d76a97faad96e0f326afb61c232b9c2a18dca35", + Author: "John Smith ", + Committer: "John Smith ", + Date: newTime("Tue Jul 11 18:03:54 2023 -0400"), + Message: strings.Builder{}, }, }, { PathB: "tzu", LineStart: 11, Commit: &Commit{ - Hash: "7bd16429f1f708746dabf970e54b05d2b4734997", - Author: "John Smith ", - Date: newTime("Tue Jul 11 18:10:49 2023 -0400"), - Message: newStringBuilderValue("Change file\n"), + Hash: "7bd16429f1f708746dabf970e54b05d2b4734997", + Author: "John Smith ", + Committer: "John Smith ", + Date: newTime("Tue Jul 11 18:10:49 2023 -0400"), + Message: newStringBuilderValue("Change file\n"), }, contentWriter: newBufferWithContent([]byte("\n\n\n\nSource: https://www.gnu.org/software/diffutils/manual/diffutils.html#An-Example-of-Unified-Format\n")), IsBinary: false, @@ -982,30 +1100,33 @@ func TestCommitParseFailureRecoveryBufferedFileWriter(t *testing.T) { PathB: ".travis.yml", LineStart: 1, Commit: &Commit{ - Hash: "df393b4125c2aa217211b2429b8963d0cefcee27", - Author: "Stephen ", - Date: newTime("Wed Dec 06 14:44:41 2017 -0800"), - Message: newStringBuilderValue("Add travis testing\n"), + Hash: "df393b4125c2aa217211b2429b8963d0cefcee27", + Author: "Stephen ", + Committer: "Stephen ", + Date: newTime("Wed Dec 06 14:44:41 2017 -0800"), + Message: newStringBuilderValue("Add travis testing\n"), }, contentWriter: newBufferedFileWriterWithContent([]byte("language: python\npython:\n - \"2.6\"\n - \"2.7\"\n - \"3.2\"\n - \"3.3\"\n - \"3.4\"\n - \"3.5\"\n - \"3.5-dev\" # 3.5 development branch\n - \"3.6\"\n - \"3.6-dev\" # 3.6 development branch\n - \"3.7-dev\" # 3.7 development branch\n - \"nightly\"\n")), IsBinary: false, }, { Commit: &Commit{ - Hash: "3d76a97faad96e0f326afb61c232b9c2a18dca35", - Author: "John Smith ", - Date: newTime("Tue Jul 11 18:03:54 2023 -0400"), - Message: strings.Builder{}, + Hash: "3d76a97faad96e0f326afb61c232b9c2a18dca35", + Author: "John Smith ", + Committer: "John Smith ", + Date: newTime("Tue Jul 11 18:03:54 2023 -0400"), + Message: strings.Builder{}, }, }, { PathB: "tzu", LineStart: 11, Commit: &Commit{ - Hash: "7bd16429f1f708746dabf970e54b05d2b4734997", - Author: "John Smith ", - Date: newTime("Tue Jul 11 18:10:49 2023 -0400"), - Message: newStringBuilderValue("Change file\n"), + Hash: "7bd16429f1f708746dabf970e54b05d2b4734997", + Author: "John Smith ", + Committer: "John Smith ", + Date: newTime("Tue Jul 11 18:10:49 2023 -0400"), + Message: newStringBuilderValue("Change file\n"), }, contentWriter: newBufferedFileWriterWithContent([]byte("\n\n\n\nSource: https://www.gnu.org/software/diffutils/manual/diffutils.html#An-Example-of-Unified-Format\n")), IsBinary: false, @@ -1034,7 +1155,9 @@ func TestCommitParseFailureRecoveryBufferedFileWriter(t *testing.T) { const recoverableCommits = `commit df393b4125c2aa217211b2429b8963d0cefcee27 Author: Stephen -Date: Wed Dec 06 14:44:41 2017 -0800 +AuthorDate: Wed Dec 06 14:44:41 2017 -0800 +Commit: Stephen +CommitDate: Wed Dec 06 14:44:41 2017 -0800 Add travis testing @@ -1074,7 +1197,9 @@ index 00000000..e69de29b commit 3d76a97faad96e0f326afb61c232b9c2a18dca35 (HEAD -> master) Author: John Smith -Date: Tue Jul 11 18:03:54 2023 -0400 +AuthorDate: Tue Jul 11 18:03:54 2023 -0400 +Commit: John Smith +CommitDate: Tue Jul 11 18:03:54 2023 -0400 diff --git a/sample.txt b/sample.txt new file mode 100644 @@ -1086,7 +1211,9 @@ index 0000000..af5626b commit 7bd16429f1f708746dabf970e54b05d2b4734997 (HEAD -> master) Author: John Smith -Date: Tue Jul 11 18:10:49 2023 -0400 +AuthorDate: Tue Jul 11 18:10:49 2023 -0400 +Commit: John Smith +CommitDate: Tue Jul 11 18:10:49 2023 -0400 Change file @@ -1360,7 +1487,9 @@ func TestMaxCommitSize(t *testing.T) { const commitLog = `commit e50b135fd29e91b2fbb25923797f5ecffe59f359 Author: lionzxy -Date: Wed Mar 1 18:20:04 2017 +0300 +AuthorDate: Wed Mar 1 18:20:04 2017 +0300 +Commit: lionzxy +CommitDate: Wed Mar 1 18:20:04 2017 +0300 Все работает, но он не принимает :( @@ -1382,10 +1511,15 @@ index 85bfb17..89b08b5 100644 commit fd6e99e7a80199b76a694603be57c5ade1de18e7 Author: Jaliborc -Date: Mon Apr 25 16:28:06 2011 +0100 +AuthorDate: Mon Apr 25 16:28:06 2011 +0100 +Commit: Jaliborc +CommitDate: Mon Apr 25 16:28:06 2011 +0100 Added Unusable coloring +Notes: + Message-Id: <1264640755-22447-1-git-send-email-user@example.de> + diff --git a/components/item.lua b/components/item.lua index fc74534..f8d7d50 100755 --- a/components/item.lua @@ -1420,17 +1554,23 @@ new file mode 160000 commit 4727ffb7ad6dc5130bf4b4dd166e00705abdd018 (HEAD -> master) Author: John Smith -Date: Tue Jul 11 22:26:11 2023 -0400 +AuthorDate: Tue Jul 11 22:26:11 2023 -0400 +Commit: John Smith +CommitDate: Tue Jul 11 22:26:11 2023 -0400 commit c904e0f5cd9f30ae520c66bd5f70806219fe7ca2 (HEAD -> master) Author: John Smith -Date: Mon Jul 10 10:17:11 2023 -0400 +AuthorDate: Mon Jul 10 10:17:11 2023 -0400 +Commit: John Smith +CommitDate: Mon Jul 10 10:17:11 2023 -0400 Empty Commit commit 3d76a97faad96e0f326afb61c232b9c2a18dca35 (HEAD -> master) Author: John Smith -Date: Tue Jul 11 18:03:54 2023 -0400 +AuthorDate: Tue Jul 11 18:03:54 2023 -0400 +Commit: John Smith +CommitDate: Tue Jul 11 18:03:54 2023 -0400 diff --git a/sample.txt b/sample.txt new file mode 100644 @@ -1442,7 +1582,9 @@ index 0000000..af5626b commit df393b4125c2aa217211b2429b8963d0cefcee27 Author: Stephen -Date: Wed Dec 06 14:44:41 2017 -0800 +AuthorDate: Wed Dec 06 14:44:41 2017 -0800 +Commit: Stephen +CommitDate: Wed Dec 06 14:44:41 2017 -0800 Add travis testing @@ -1482,7 +1624,9 @@ index 00000000..e69de29b commit 4218c39d99b5f30153f62471c1be1c1596f0a4d4 Author: Dustin Decker -Date: Thu Jan 13 12:02:24 2022 -0800 +AuthorDate: Thu Jan 13 12:02:24 2022 -0800 +Commit: Dustin Decker +CommitDate: Thu Jan 13 12:02:24 2022 -0800 Initial CLI w/ partially implemented Git source and demo detector (#1) @@ -1538,7 +1682,9 @@ index 00000000..7fb2f73c commit 934cf5d255fd8e28b33f5a6ba64276caf0b284bf (HEAD -> master) Author: John Smith -Date: Tue Jul 11 18:43:22 2023 -0400 +AuthorDate: Tue Jul 11 18:43:22 2023 -0400 +Commit: John Smith +CommitDate: Tue Jul 11 18:43:22 2023 -0400 Test toFile/plusLine parsing @@ -1554,7 +1700,9 @@ index 0000000..451be67 commit 2a5d703b02b52d65c65ee9f7928f158b919ab741 Author: Sergey Beryozkin -Date: Fri Jul 7 17:44:26 2023 +0100 +AuthorDate: Fri Jul 7 17:44:26 2023 +0100 +Commit: Sergey Beryozkin +CommitDate: Fri Jul 7 17:44:26 2023 +0100 Do not refresh OIDC session if the user is requesting logout @@ -1662,7 +1810,9 @@ index 51e1b9a932d..472c2743bc4 100644 commit 2a057632d7f5fa3d1c77b9aa037263211c0e0290 Author: rjtmahinay -Date: Mon Jul 10 01:22:32 2023 +0800 +AuthorDate: Mon Jul 10 01:22:32 2023 +0800 +Commit: rjtmahinay +CommitDate: Mon Jul 10 01:22:32 2023 +0800 Add QuarkusApplication javadoc @@ -1680,7 +1830,9 @@ index 350685123d5..87d2220eb98 100644 commit bca2d17491015ea1522f34517223b5a366aea73c (HEAD -> master) Author: John Smith -Date: Tue Jul 11 18:12:21 2023 -0400 +AuthorDate: Tue Jul 11 18:12:21 2023 -0400 +Commit: John Smith +CommitDate: Tue Jul 11 18:12:21 2023 -0400 Delete binary file @@ -1691,7 +1843,9 @@ Binary files a/trufflehog_3.42.0_linux_arm64.tar.gz and /dev/null differ commit afc6dc5d47f28366638da877ecb6b819c69e659b Author: John Smith -Date: Mon Jul 10 12:21:33 2023 -0400 +AuthorDate: Mon Jul 10 12:21:33 2023 -0400 +Commit: John Smith +CommitDate: Mon Jul 10 12:21:33 2023 -0400 Change binary file @@ -1701,7 +1855,9 @@ Binary files a/trufflehog_3.42.0_linux_arm64.tar.gz and b/trufflehog_3.42.0_linu commit 638595917417c5c8a956937b28c5127719023363 Author: John Smith -Date: Mon Jul 10 12:20:35 2023 -0400 +AuthorDate: Mon Jul 10 12:20:35 2023 -0400 +Commit: John Smith +CommitDate: Mon Jul 10 12:20:35 2023 -0400 Add binary file @@ -1712,7 +1868,9 @@ Binary files /dev/null and b/trufflehog_3.42.0_linux_arm64.tar.gz differ commit ce0f5d1fe0272f180ccb660196f439c0c2f4ec8e (HEAD -> master) Author: John Smith -Date: Tue Jul 11 18:08:52 2023 -0400 +AuthorDate: Tue Jul 11 18:08:52 2023 -0400 +Commit: John Smith +CommitDate: Tue Jul 11 18:08:52 2023 -0400 Delete file @@ -1736,7 +1894,9 @@ index 635ef2c..0000000 commit d606a729383371558473b70a6a7b1ca264b0d205 Author: John Smith -Date: Mon Jul 10 14:17:04 2023 -0400 +AuthorDate: Mon Jul 10 14:17:04 2023 -0400 +Commit: John Smith +CommitDate: Mon Jul 10 14:17:04 2023 -0400 Rename file @@ -1747,7 +1907,9 @@ rename to tzu.txt commit 7bd16429f1f708746dabf970e54b05d2b4734997 (HEAD -> master) Author: John Smith -Date: Tue Jul 11 18:10:49 2023 -0400 +AuthorDate: Tue Jul 11 18:10:49 2023 -0400 +Commit: John Smith +CommitDate: Tue Jul 11 18:10:49 2023 -0400 Change file @@ -1764,7 +1926,9 @@ index 5af88a8..c729cdb 100644 commit c7062674c17192caa284615ab2fa9778c6602164 (HEAD -> master) Author: John Smith -Date: Mon Jul 10 10:15:18 2023 -0400 +AuthorDate: Mon Jul 10 10:15:18 2023 -0400 +Commit: John Smith +CommitDate: Mon Jul 10 10:15:18 2023 -0400 Create files @@ -1824,10 +1988,11 @@ func expectedDiffs() []*Diff { PathB: "C++/1 \320\243\321\200\320\276\320\272/.idea/workspace.xml", LineStart: 29, Commit: &Commit{ - Hash: "e50b135fd29e91b2fbb25923797f5ecffe59f359", - Author: "lionzxy ", - Date: newTime("Wed Mar 1 18:20:04 2017 +0300"), - Message: newStringBuilderValue("Все работает, но он не принимает :(\n"), + Hash: "e50b135fd29e91b2fbb25923797f5ecffe59f359", + Author: "lionzxy ", + Committer: "lionzxy ", + Date: newTime("Wed Mar 1 18:20:04 2017 +0300"), + Message: newStringBuilderValue("Все работает, но он не принимает :(\n"), }, contentWriter: newBufferWithContent([]byte("\n\n\n \n \n\n\n\n")), IsBinary: false, @@ -1836,10 +2001,11 @@ func expectedDiffs() []*Diff { PathB: "components/item.lua", LineStart: 9, Commit: &Commit{ - Hash: "fd6e99e7a80199b76a694603be57c5ade1de18e7", - Author: "Jaliborc ", - Date: newTime("Mon Apr 25 16:28:06 2011 +0100"), - Message: newStringBuilderValue("Added Unusable coloring\n"), + Hash: "fd6e99e7a80199b76a694603be57c5ade1de18e7", + Author: "Jaliborc ", + Committer: "Jaliborc ", + Date: newTime("Mon Apr 25 16:28:06 2011 +0100"), + Message: newStringBuilderValue("Added Unusable coloring\n\nNotes:\nMessage-Id: <1264640755-22447-1-git-send-email-user@example.de>\n"), }, contentWriter: newBufferWithContent([]byte("\n\nlocal Unfit = LibStub('Unfit-1.0')\n\n\n")), IsBinary: false, @@ -1849,10 +2015,11 @@ func expectedDiffs() []*Diff { LineStart: 6, contentWriter: newBufferWithContent([]byte("\n\n