I wrote an in-depth article about .git-blame-ignore-revs file found in React source code, but in this article, let’s draw a comparison between React and Refine codebase’s .git-blame-ignore-revs.
# Since version 2.23 (released in August 2019), git-blame has a feature# to ignore or bypass certain commits.## This file contains a list of commits that are not likely what you# are looking for in a blame, such as mass reformatting or renaming.## Run the following command to apply this file as the default ignore file.## git config blame.ignoreRevsFile .git-blame-ignore-revs# chore: format all files (#5684)# https://github.com/refinedev/refine/pull/5684# This commit updates the linter and formatter configuration and applies to all relevant files.16eefc493da3e66a095a11d9dcbeff0ec64dca57
This above code is picked from the .git-blame-ignore-revs file in Refine codebase as shown in the below image:
So let’s talk about differences, before you read further, try to come up with your own differences that you have identified.
I like the fact that there is a comment in Refine’s .git-blame-ignore-revs explaining what this file is about and also points to the PR that has all those formatting changes that can be safely ignored when looking to blame who wrote a line.
The reason why you do this is, if you have changed formatting all across the codebase, the blame overrides the original author’s line with your formatting and there’s no way you could tell when you use ‘blame’ feature in Git.
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.