0

I'd like to make it so that when I type in svn diff it uses vim to view the diffs. I asked about this at https://stackoverflow.com/q/25558639/569976 I was referred to Change default SVN diffing tool . Per that I tried svn diff -dif-cmd vim but that gives me this error:

Index: path/to/file.ext
===================================================================
4 files to edit
E282: Cannot read from "-L"
Press ENTER or type command to continue

Any ideas?

Community
  • 1
  • 1
neubert
  • 15,947
  • 24
  • 120
  • 212
  • Possible duplicate of [How to view svn diff in vimdiff style in svn](http://stackoverflow.com/questions/7866286/how-to-view-svn-diff-in-vimdiff-style-in-svn) – agold Mar 04 '16 at 11:33

2 Answers2

3

The same error occurred to me, and this was because I put vimdiff directly in the subversion configuration (~/.subversion/config) at the field diff-cmd. It seems that the files to check are not past as first and second parameter, therefore you have to write a wrapper script:

#!/bin/sh
/usr/bin/vimdiff ${6} ${7}

And then put this in the subversion configuration file:

diff-cmd = /path/../vimwrapperscript.sh

You should make it executable (chmod +x), and you cannot use ~ in the configuration file to refer to your home, you should use the full path.

See also:

Community
  • 1
  • 1
agold
  • 6,140
  • 9
  • 38
  • 54
0

You need to make some sort of script wrapping around vimdiff to pass the correct arguments. Looking at the answer you pulled from will show you the arguments as passed. vimdiff just needs the file names.

Ben
  • 8,725
  • 1
  • 30
  • 48