Colourful SVN Diff on Mac OS X

I do not particulary like SVN but sometimes I have to use it. The diff output on the Mac OS X command line usually is not colored which is annoying. The solution is to tell SVN it should use colordiff instead. You can easily install colordiff using homebrew:

brew install colordiff

Then change your SVN configuration to use colordiff using vi ~/.subversion/config; add the following line:

diff-cmd = colordiff

Then a svn diff should be colored (with ugly colours). To change this, run vi ~/.colordiffrc to set up your colordiff preferences and enter the following setup:

# Set banner=no to suppress authorship info at top of
# colordiff output
banner=no
# By default, when colordiff output is being redirected
# to a file, it detects this and does not colour-highlight
# To make the patch file *include* colours, change the option
# below to 'yes'
color_patches=no
# available colours are: white, yellow, green, blue,
# cyan, red, magenta, black,
# darkwhite, darkyellow, darkgreen,
# darkblue, darkcyan, darkred,
# darkmagenta, darkblack
plain=black
newtext=darkgreen
oldtext=darkred
diffstuff=darkblue
cvsstuff=darkwhite

Resources

Comments