Last Updated: February 25, 2016
·
1.002K
· kablamo

Review recent commits with git-ribbon

I wrote a little Perl script called git-ribbon to help me review the latest changes in a git repository.

The way I used to review changes was by reading through the git log. I try to do this every morning at work to keep up with whats going on. But I was having a few problems:

  1. Its hard to know exactly which changes are new.
  2. I want to review commits in the order they happened (instead of most recent first).
  3. git log diff output can be hard to read and may not have enough context -- sometimes I want a side by side diff like I get from vimdiff or git difftool.

Basically I wanted a quick and easy way to review the latest changes in a way that feels a little more like an RSS feed. So I wrote this script.

How to use git-ribbon

First mark your current place in the commit history. This command will place a tag named _ribbon at origin/master. Basically its a bookmark at your current location.

⚡ git ribbon --save

Next, pull the latest changes made by your fellow conspirators from the remote repository.

⚡ git pull

Then use git ribbon to review only the changes that have occurred since _ribbon:

⚡ git ribbon
Eric Johnson 6 weeks ago ecf43db
Css tweaks.
root/html/calculator/realCost.tt

press 's' to skip 

Eric Johnson 4 weeks ago 9595fa0
fix css margin class.
root/css/networth.css
root/css/style.less
root/css/style.less.old
root/html/calculator/realCost.tt
root/html/fi.tt

press 's' to skip 

Eric Johnson 2 weeks ago 5ef0fb2
Added daysPerYear.
lib/Networth/Controller/Calculator.pm
lib/Networth/Out/RealCost.pm
root/html/calculator/realCost.tt

press 's' to skip 

The script will pause and wait for input when it prints press 's' to skip. If you type anything other than s, it will show you the side by side diff using git difftool.

For more info read the full blog post.