Skip to content

Instantly share code, notes, and snippets.

@nahumnp
Forked from dtjm/config
Created September 5, 2016 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nahumnp/dafc4ed94aff0a2711a3594a69cff5b5 to your computer and use it in GitHub Desktop.
Save nahumnp/dafc4ed94aff0a2711a3594a69cff5b5 to your computer and use it in GitHub Desktop.
Wrapper to use OS X FileMerge when calling `svn diff`
### ~/.subversion/config
### Add this line to the [helpers] section
diff-cmd = ~/bin/svn-diffwrap.sh
#!/bin/sh
#
# Put this somewhere like ~/bin and make it executable
# `chmod +x ~/bin/svn-diffwrap.sh`
##################################################
### Configure your favorite diff program here. ###
##################################################
# MacVim
#DIFF="/Users/username/bin/mvim -d"
# Vim
#DIFF="/usr/bin/vimdiff"
# OS X FileMerge
DIFF="/usr/bin/opendiff"
##################################################
# Subversion provides the paths we need as the ###
# sixth and seventh parameters. ###
##################################################
LEFT=${6}
RIGHT=${7}
###################################################
### Call the diff command (change the following ###
### line to make sense for your merge program). ###
###################################################
$DIFF $LEFT $RIGHT
# Return an errorcode of 0 if no differences were detected, 1 if some were.
# Any other errorcode will be treated as fatal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment