Skip to content

Instantly share code, notes, and snippets.

@cpelley
Last active October 13, 2016 07:18
Show Gist options
  • Save cpelley/c29d83fd6285235c351f7684e7e1ab56 to your computer and use it in GitHub Desktop.
Save cpelley/c29d83fd6285235c351f7684e7e1ab56 to your computer and use it in GitHub Desktop.
svn diff (vimdiff)
#!/bin/sh
# Add the following to the [helpers] section of ~/.subversion/config
# merge-tool-cmd = /path/to/svn_merge_vimdiff.sh
BASE=${1}
THEIRS=${2}
MINE=${3}
MERGED=${4}
WCPATH=${5}
# Call the diff command
# Using confirm $$ <command> is useful here https://gist.github.com/cpelley/b0c68de930bdea4f9f93a3677df0b44a
vimdiff ${MINE} ${THEIRS} -c ":bo sp ${MERGED}" -c ":diffthis" \
-c "setl stl=MERGED:${MERGED} | wincmd W | setl stl=THEIRS:${THEIRS} | wincmd W | setl stl=MINE:${MINE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment