randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.59k stars 569 forks source link

Add a .git-blame-ignore-revs file #4439

Open reneme opened 2 days ago

reneme commented 2 days ago

This cleans up git blame (also tig 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 --global blame.ignoreRevsFile .git-blame-ignore-revs
git config --global 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.

coveralls commented 2 days ago

Coverage Status

coverage: 91.072% (+0.009%) from 91.063% when pulling 06da719a73ef6a28eaa4f930aebe83d5d24e6ab5 on reneme:chore/hide_clang_format_in_blame into e5ec40828c2113d4b4f1dbe52bc8f363ec478a20 on randombit:master.