Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .Line to reduce diff strangeness #380

Merged
merged 1 commit into from
Apr 11, 2022

Conversation

bill-rich
Copy link
Collaborator

Using .String() results in the op ("+") and extra newlines. Switching to .Line removes both of these. Expected chunks adjusted for raw chunk changes.

--trace option also added for easier debugging

@bill-rich bill-rich requested review from mcastorina and a team April 11, 2022 19:05
@@ -278,6 +278,7 @@ func (s *Git) ScanCommits(repo *git.Repository, path string, scanOptions *ScanOp

var depth int64
for file := range fileChan {
log.WithField("commit", file.PatchHeader.SHA).WithField("file", file.NewName).Trace("Scanning file from git")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: There's also log.WithFields that I just learned about:

log.WithFields(log.Fields{"commit": file.PatchHeader.SHA, "file": file.NewName}).Trace("scanning file from git")

@dustin-decker dustin-decker merged commit af979d4 into main Apr 11, 2022
@dustin-decker dustin-decker deleted the thog-196_massage_git_diff_input branch April 11, 2022 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants