pfritz

January 4, 2010

Color your diffs

Filed under: Uncategorized — pfritz @ 2:00

I’m using the command “svn diff” very often to control my already done changes for the subversion repo I’m working on. To be exactly I’m using “svn diff | colordiff” because it simplifies reading those diffs enormous. Since colordiff is a simple wrapper around the good old diff, I was wondering if it is possible to change the diff command used by subversion to something else. And yes it is! After some googling I found out the solution to define an alias to use colordiff, but an alias is not what I want. There must be a neater solution. Looking into the config file ‘.subversion/config’ I uncomment and changed the line starting with diff-cmd to ‘diff-cmd = colordiff’ and now the output of ‘svn diff’ is colored. Isn’t that nice? What I haven’t found out yet, however, is how you can change it back to normal diff if you want to prepare a normal patch without colors. I’ll report it to you if I find it out.

Blog at WordPress.com.