Ignore big reformatting commits in GitHub blame UI#4741
Merged
waiting-for-dev merged 1 commit intosolidusio:masterfrom Nov 29, 2022
Merged
Conversation
By adding a .git-blame-ignore-revs file that contains the commits that git blame will ignore, we are able to remove them from the blame view when using this feature. See https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view for extra details. For now, I added just a couple of big commits, but we can add more with time. This same behavior can be enabled locally with: git config blame.ignoreRevsFile .git-blame-ignore-revs This config is not suitable as a global config though, because it will fail on repositories that do not have the file set.
5 tasks
adammathys
approved these changes
Nov 29, 2022
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
By adding a
.git-blame-ignore-revsfile that contains the commits that git blame will ignore, we are able to remove them from the blame view when using this feature.See https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view for extra details.
From that link it's worth mentioning that:
For now, I added just a couple of big commits, but we can add more with time.
This same behavior can be enabled locally with:
This config is not suitable as a global config though, because it will fail on repositories that do not have the file set.
Other resources:
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed (
cross them outif they are not):I have added automated tests to cover my changes.I have attached screenshots to demo visual changes.I have opened a PR to update the guides.