I am starting to use Subversion on Linux. svn diff
gives a very cryptic view—very, very unfriendly to eyes. How do I interpret its output? And more importantly, is there a way to view the difference in vimdiff kind of neat style, where both files will open side by side?
Edit the file $HOME/.subversion/config
so it contains the line:
diff-cmd = <your favorite diff application>
Some diff apps support svn. For example, diff-cmd = meld
should work fine. However, vimdiff
is not one of them. The reason for that is that svn diff
gives the files to be compared as 6th and 7th arguments, and not as 1st and 2nd as usual. So what most people do in this situation is this:
Create a wrapper script:
#!/bin/sh
/usr/bin/vimdiff ${6} ${7}
Save it, for example, at $HOME/bin/svndiffwrap.sh
Do not forget to make it executable chmod +x $HOME/bin/svndiffwrap.sh
.
Make it the svn diff command:
in $HOME/.subversion/config
:
diff-cmd = /home/<username>/bin/svndiffwrap.sh
Note: Some svn clients do not support paths that uses $HOME
environment variable. So it is useful to specify full path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With