Using colordiff and the Subversion CLI

Published on 2014-01-05 by John Collins.

My policy is to use the CLI interfaces of version control systems whenever possible, as this means I can move from computer to computer and still be productive without worrying about what version control clients are installed there. As I am running diffs before I commit anything to Subversion or Git, it is kinder on my eyes to have them coloured in order to highlight the code changes. This can be achieved using the colordiff command in Linux.

Before we begin, make sure you have that command installed:

$ yum install colordiff

To run a regular diff using the Subversion CLI, I ran the following command to get this output:

$ svn diff view/renderers/html/

Now let us try that again, only this time piping the output from svn diff to colordiff:

$ svn diff view/renderers/html/ | colordiff

I think you will find that the colours will really help while scanning through your diffs.