chore: Improve blame view by ignoring formatting from Prettier #1409
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.
What's the purpose of this pull request?
Create a
.git-blame-ignore-revs
file to list commits that should be ignored from the blame view. This is useful to remove the noise introduced by aesthetic changes such as code formatting: when viewing the blame for a file, we can omit commits that only changed formatting/indentation so we can quickly see what matters.I had mentioned that #1369 was a good candidate to test this feature (that is relatively new in GH, not Git itself).
How does it work?
By adding a commit SHA/ID to be ignored in the
.git-blame-ignore-revs
file.How to test it?
See how on Before the changes from the commit "fix: prettier format files", which were only formatting, hid the original blame lines. On After they're restored because that commit is ignored.
References