-
Notifications
You must be signed in to change notification settings - Fork 570
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
Add a .git-blame-ignore-revs file #4439
base: master
Are you sure you want to change the base?
Conversation
a5d6abb
to
06da719
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful!
Given that git doesn't understand this by default, I disagree with your assessment re top level directory. Fine for src/configs
.
Maybe also worth a mention in the contributing guide.
This cleans up 'git blame' by automatically skipping commits that just reformatted code using clang-format. The name of the ignore- file isn't standard, but it seems to be the convention. To use this, you'll have to adapt your checkout's git config, by running the following commands from within your local checkout: git config --local blame.ignoreRevsFile src/configs/git-blame-ignore-revs git config --local blame.markIgnoredLines true The first config enables the usage of the ignore file by default, the second one marks blame-lines with a '?' if they skipped one or more commits.
06da719
to
b4ab5d3
Compare
In fact, its probably better to not configure this globally after all. It seems that (at least)
Done. |
This cleans up
git blame
(alsotig blame
or VSCode's GitLens annotations) by automatically skipping commits that just reformatted code using clang-format. The name of the ignore-file isn't standard, but it seems to be the convention across the community.Leaving this as a "Draft" for now. I personally just learnt about this feature, and find it super useful (worthy of a new top-level file 😏)To use this, you'll have to adapt your git config like so:
git config --local blame.ignoreRevsFile src/configs/git-blame-ignore-revs git config --local blame.markIgnoredLines true
The first config enables the usage of the ignore file by default, the second one marks blame-lines with a '?' if they skipped one or more commits.