Take the Blame: A Git Plugin for Unearned Credit
We've all been there. You're looking at a beautiful piece of code, a clever fix, or an elegant refactor in the git history, and you think, "I wish I wrote that." The standard git blame is great for finding out who to actually thank (or question) for a specific line. But what if you want to bask in the glory of code you had nothing to do with? Enter git-self-blame.
It's the git plugin you never knew you needed, turning the traditional blame game on its head. Instead of exposing the true author, it lets you claim any line of code as your own. It's a playful, clever twist on a core developer tool that highlights how we interact with our repositories every day.
What It Does
git-self-blame is a git plugin that subverts the classic git blame command. When you run git self-blame on a file, it produces output that looks exactly like the standard blame, but with one crucial difference: your name and email are listed as the author for every single line.
It walks through the commit history, line by line, but replaces the original author information with your own details from your git config. The commit hashes and actual code changes remain untouched and accurate—only the attribution is... creatively reassigned.
Why It's Cool
On the surface, it's a fun joke. It’s the ultimate tool for taking credit in a codebase, a humorous way to "claim" that brilliant algorithm from a senior dev or that perfect one-liner from a colleague.
But dig a little deeper, and it's a neat piece of meta-commentary on version control and ownership. It plays with the concept of "blame" as both a technical command and a social construct in software development. The implementation is straightforward and clever, hooking into git's plumbing to faithfully replicate the blame format while swapping out the author data. It’s a reminder that our tools can be bent in creative, unexpected ways.
How to Try It
Getting started is simple. It's a standard Ruby gem.
First, install it:
gem install git-self-blame
Then, navigate to any git repository and run it just like you would normal blame, but for yourself:
git self-blame path/to/your/file.rb
You'll see the familiar blame output, but you'll be the star of every line. The project's GitHub repository has all the details if you want to peek at the source or report issues.
Final Thoughts
While you probably shouldn't use this output in a serious code review, git-self-blame is a brilliant bit of developer humor. It's a lightweight, well-executed idea that brings a smile and maybe a moment of reflection on how we assign credit. Use it to prank a teammate, to create a silly screenshot for your desk, or just to appreciate the clever hack behind it. In a world of serious dev tools, it's nice to have one that doesn't take itself too seriously.
@githubprojects
Repository: https://github.com/JacobEvelyn/git-self-blame