Skip to content

Instantly share code, notes, and snippets.

@alexmurray
Last active April 10, 2018 01:42
Show Gist options
  • Save alexmurray/6562b7aadb04e101bd1b to your computer and use it in GitHub Desktop.
Save alexmurray/6562b7aadb04e101bd1b to your computer and use it in GitHub Desktop.
Improve svn diff to be more like git diff
# a nicer git-like svn diff which also works for svn externals which
# normally svn diff doesn't show
function svndiff () {
svn status $* | grep '^ *[ADM]' | cut --complement -c -8 | awk '{printf "%s%c", $0, 0}' | xargs -0 svn diff -x -up --depth=files | colordiff | less -R;
}
function svndiffstat () {
svn status $* | grep '^ *[ADM]' | cut --complement -c -8 | awk '{printf "%s%c", $0, 0}' | xargs -0 svn diff -x -up --depth=files | diffstat -C -p0
}
# a nicer svn up which works with svn externals
function svnup () {
svn update --ignore-externals $*
svn status | grep 'X ' | cut --complement -c -8 | awk '{printf "%s%c", $0, 0}' | xargs -0 svn up $*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment