-
-
Save dtjm/523243 to your computer and use it in GitHub Desktop.
| ### ~/.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. |
Awesome one, thanks!
Put quotes around $LEFT and $RIGHT on line 30 to handle filenames and paths with spaces:
$DIFF "$LEFT" "$RIGHT"
When I run your script via the terminal a la:
svn diff --diff-cmd ~/bin/svn-diffwrap.sh
It works fine.
But when I edit the ~/.subversion/config file, like you illustrated above, I get something like this:
computer:svn rstackhouse$ svn diff
Index: <file>
===================================================================
exec of '~/bin/svn-diffwrap.sh' failed: No such file or directorysvn: E200012: '~/bin/svn-diffwrap.sh' returned 255
Any idea why?
Any idea why?
Try using the full home directory path instead of ~.
Even I get this error when i do svn diff on terminal app (OS X 10.11.1)
exec of 'svn-diffwrap.sh' failed: No such file or directorysvn: E200012: 'svn-diffwrap.sh' returned 255
I moved the file to ~/.subversion folder (parallel to config) and updated ~/.subversion/config [helpers] with
diff-cmd=svn-diffwrap.sh
And, I made it executable using the mentioned command
$ls -l svn-diffwrap.sh
-rwxr-xr-x@ 1 staff 959 Nov 3 14:53 svn-diffwrap.sh
Any help please?
Ok, I found a solution for the error mentioned above (no such file or directory)...
diff-cmd=/Users/<YourUser>/.subversion/svn-diffwrap.sh
i.e. specify full path from '/' folder
@dtjm @iosappdeveloper This is a useful fix to specify svn-diffwrap. Saved me a ton of time. @changetip $1
This is handy, thanks. I am using svn 1.7.10 and it doesn't seem to like the ~ in the config file. Any tips to get this working?
Edit: In the mean time, I've moved svn-diffwrap.sh into the .subversion directory, and now .subversion/config uses:
diff-cmd = svn-diffwrap.sh
Works as expected.