Friday, April 8, 2011

i heart tig

I try not to write about something until I feel like I know it fairly well, but tig's causing me to break those rules. At its root it's only a prettier command line interface to git. To use it just run any normal git command and pass the output to tig.

For example: git log --author=jess | tig

That's something I do fairly frequently. This gives you a colored commit history. Not too exciting yet, but wait for it. You can then scroll down through that output and hit enter on any of the commit numbers to see the actual diff. To bring it to the next level add this to your .tigrc:

bind diff r !open http://your_code_review_server/%(commit)

Obviously you'll have to modify this to fit the url type you use, but now typing r in the diff view will jump you straight to your code reviewing site. I know it sounds dry but it's amazing for catching up on code reviews or just exploring the git history.

tig also supports views other than log and diff, I just haven't explored them much yet. Have fun.