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.
Before you continue reading this article, I recommend you first read my article,
.git-blame-ignore-revs
to ignore bulk formatting changes, to understand what this file is about.
Let me first provide the code inside the files — .git-blame-ignore-revs
.git-blame-ignore-revs in React codebase
c998bb1ed4b3285398c9c7797135d3f060243c6a
fd2b3e13d330a4559f5aa21462e1cb2cbbcf144b
I copied this above code from the file shown in the below image.
.git-blame-ignore-revs in Refine codebase
# 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.
The comment
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.
Numbers of revs ignored
There’s two commit hashes in React codebase and there is only 1 commit hash in Refine codebase.
About me:
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.
I am open to work on interesting projects. Send me an email at ramu.narasinga@gmail.com
My Github — https://github.com/ramu-narasinga
My website — https://ramunarasinga.com
My Youtube channel — https://www.youtube.com/@thinkthroo
Learning platform — https://thinkthroo.com
Codebase Architecture — https://app.thinkthroo.com/architecture
Best practices — https://app.thinkthroo.com/best-practices
Production-grade projects — https://app.thinkthroo.com/production-grade-projects
Top comments (0)