A long-standing objection to making bulk changes to code using automated tools (e.g. to conform to a given code style) is that it clutters the output

Ignoring bulk change commits with git blame

submited by
Style Pass
2021-06-29 23:30:05

A long-standing objection to making bulk changes to code using automated tools (e.g. to conform to a given code style) is that it clutters the output of git blame. With git 2.23, this does not have to be the case anymore! In this post I will start by explaining the value of git blame and how commits with style changes in bulk can be problematic. If you already understand this problem and just want a solution, you can directly skip to the new features git 2.23 has to offer.

A characteristic feature of legacy code is that it's often not clear why it operates the way that it does. Some of the original developers may have left or have been reassigned to another project, documentation is virtually nonexistent, and the few remaining developers do not remember all the details anymore. For example, one day you might stumble upon the follow piece of code:

Despite being an artificial example, this code already raises some questions. Why is the default amount of bottles being described 42? And why do we describe bottles of cider? Bottles of beer would be a more customary alternative, right? Still these choices were probably made for a good reason; it's just that we don't know that reason.

Leave a Comment