Skip to content

Instantly share code, notes, and snippets.

@rochefort
Created February 1, 2015 08:17
Show Gist options
  • Save rochefort/3638cf1b3048c641f557 to your computer and use it in GitHub Desktop.
Save rochefort/3638cf1b3048c641f557 to your computer and use it in GitHub Desktop.
svn diff wrapper
function sdr {
local rev;
local file;
if [ $# = 1 ]; then
if expr "$1" : '[0-9]*' > /dev/null ; then
rev=$1;
file='';
else
file=$1
rev=$(svn ls -v $file | awk '{print $1}')
fi
else
rev=$1
file=$2
fi
local bef_rev=$(expr $rev - 1)
svn diff -x -b -r $bef_rev:$rev $file | less -r
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment