Coloured, paged subversion diff output on Linux-like computers


Using subversion from the command line (svn), I often complained (to myself at least) about the bland output from a svn diff command. This isn’t strictly a subversion problem, since your regular diff gives the same uninspired output.

Here’s how to add automatic paging and highlight changes in bright colours.

Install colordiff on Ubuntu:

apt-get install colordiff

OS X:

port install colordiff

Make a new file called svndiff with the following inside:

#!/bin/bash
svn diff $* | colordiff | less -r

Make this file executable (chmod +x svndiff) and copy it somewhere in your path (I put it in /usr/local/bin).

The $* bash argument passes any arguments you give the script to the svn diff command, so you can still do things like:

svndiff file1 file2
Share this post
  • Digg
  • StumbleUpon
  • Reddit
  • del.icio.us
  • Facebook
  • muti
  • Mixx
  • Google
  • laaik.it

This entry was posted on Wednesday, April 1st, 2009 at 2:54 pm and is filed under subversion. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Coloured, paged subversion diff output on Linux-like computers”

  1. Jack Carter said this on

    i love r&b music becaue it sounds soothing to my ears.*,,

Leave a Reply