Colorful svn diff

October 30, 2012 at 18:32

Who doesn’t love colors in a terminal 😀 ? At least I do, so I usually have the following function defined in my bashrc file:

function svn {
        if [ "$1" == "diff" ] ; then
                `which svn` diff --diff-cmd diff -x -uw $@ | colordiff
                `which svn` $@

In case the first argument is diff, I invoke the svn command defined in the path specifing the diff command that I want to use. This includes some diff tweaks to ignore spaces and that kind of stuff, and also the colordiff command to give it a nicer look :). Also, the function can be extended to do special stuff with other svn commands.