svndiff
Just a small productivity tip today. I have this in my .alias file (or put it in your .bashrc or somewhere).
svndiff () { svn diff "$*" | colordiff | less; }
When you now run svndiff where you would normally run svn diff you get a nice diff in colors (which is pretty addictive) and it uses less as a pager, so no need for the | less anymore…
Inspired by “git diff”?
Thanks for sharing, somehow I did not think that far until today.
At least for coloring you don’t need an alias:
Edit your ~/.subversion/config and set
diff-cmd = colordiff
And don’t you need less -r for coloring to work?
I prefer diff-cmd=kdiff3
You might also consider this ;)
svn() {
if [[ $1 == "diff" ]]; then
/usr/bin/svn "$@" | colordiff | less
else
/usr/bin/svn "$@"
fi
}
this way it’s quite transparent ;)
@Flameeyes Ah, nice to hear from you again! And indeed your version is better. Adjusted my .alias….
Oh, nice.
I currently have:
function svnless() { svn diff $@ | vim – -R }
but i beleive yours will be faster :)
Color did not work for me with less. Adding the following line before your or Diegos lines did the trick:
alias less=”less -R” # Enable colors in less.
I have something similar for some years now.
Only I use vim to display the diff…