Fri 11 Nov 2022
Exclude linting & formatting commits when running Git blame
SHARE THIS POST
Automatic code linters and formatters are a handy way to get consistent formatting across a codebase and avoid those painful bikeshedding arguments over exactly where the curly braces should go. But running one on an existing codebase has always come at a cost: the mess it creates in a commit history as the formatting commits insert themselves all over the git blame output, diverting you from the commits that made the last meaningful change. In fact this is often cited as the main reason folks won’t run a formatter on older codebases where the history is an important source of documentation.