subversion diff

Normally, subversion uses a builtin diff command to show you your changes. This works pretty well most of the time, except that you can’t use it to disable whitespace-only changes. How to do this isn’t spelled out 100% clearly in the FAQ, so here’s what I found out:

  1. Make a shell script ~/bin/svn_diff. It should look like this:
    exec diff -bu "$@"
  2. chmod +x ~/bin/svn_diff
  3. Put these lines in ~/.subversion/config:
    diff-cmd = /home/dom/bin/svn_diff

Naturally, you can adjust the diff flags to taste in the svn_diff script..

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s