This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Git blame: make ignoring whitespace configurable#58134
Merged
Merged
Conversation
camdencheek
commented
Nov 6, 2023
Comment on lines
-24
to
+36
| var hunksResolver []*hunkResolver | ||
| hunkResolvers := make([]*hunkResolver, 0, len(hunks)) | ||
| for _, hunk := range hunks { | ||
| hunksResolver = append(hunksResolver, &hunkResolver{ | ||
| hunkResolvers = append(hunkResolvers, &hunkResolver{ | ||
| db: r.db, | ||
| repo: r.commit.repoResolver, | ||
| hunk: hunk, | ||
| }) | ||
| } | ||
|
|
||
| return hunksResolver, nil | ||
| return hunkResolvers, nil |
Member
Author
There was a problem hiding this comment.
unrelated, just cleaning up some weird naming and extra allocations
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff a465ffc...6ca82f6.
|
Contributor
eseliger
approved these changes
Nov 6, 2023
| EndLine int32 | ||
| StartLine int32 | ||
| EndLine int32 | ||
| IgnoreWhitespace *bool |
Contributor
|
In case it's relevant: Currently the blame view uses a separate endpoint to get streamed blame information. I guess it uses this function under the hood too. Just mentioning it since you've been changing the GraphQL API. |
fkling
approved these changes
Nov 7, 2023
Member
Author
I made the change in two places! The streaming API doesn't have any arguments, so it effectively changes the default without making it configurable. |
vovakulikov
pushed a commit
that referenced
this pull request
Dec 12, 2023
Currently, our git blame API endpoint adds the -w flag to git blame, which causes whitespace-only changes to be ignored when blaming a line. This is different than GitHub's behavior, and a confusing default. This makes the ignoring whitespace configurable in the GraphQL enpdoint, and disables it by default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, our
git blameAPI endpoint adds the-wflag togit blame, which causes whitespace-only changes to be ignored when blaming a line. This is different than GitHub's behavior, and a confusing default.This makes the ignoring whitespace configurable in the GraphQL enpdoint, and disables it by default.
Test plan
Git blame for this file now matches what GitHub shows.