How can I get SnailSvn to run a custom diff command? How can I make SnailSvn use vimdiff or any custom diff script? It only has a predefined list of options.
To setup its diff support (for opendiff aka FileMerge), it asks you to copy the following script to:
~/Library/Application Scripts/net.langui.SnailSVN.DiffTool/difftool.sh
#!/bin/bash
pkill -nf ScriptMonitor
sh &quot;$@&quot;

The argument is a generated diff-cmd.sh file that looks something like this:
#/bin/bash
&quot;/Applications/Xcode.app/Contents/Developer/usr/bin/opendiff&quot; &quot;/var/folders/nn/000000000000000000000000000000/T/net.langui.SnailSVNFree//r422640 Code.cs&quot; &quot;/Users/idbrii/code/game/Assets/Standard Assets/Unlit/Planes/Code.cs&quot;

I tried to replace it with something like:
#!/bin/bash
args=$(grep opendiff &quot;$@&quot; | cut -d\  -f2-)
echo mvimdiff $args &gt;&gt; ~/snailsvndifftool.log 2&gt;&amp;1

But instead I get too many files -- despite files containing quotes, they're still split up by spaces.
With the help of this answer, I found eval:
#!/bin/bash
args=$(grep opendiff &quot;$@&quot; | sed -e 's,&quot;/Applications/Xcode.app/Contents/Developer/usr/bin/opendiff&quot;,/usr/local/bin/mvimdiff,')
echo diff: $args &gt;&gt; ~/snailsvndifftool.log 2&gt;&amp;1
# What's this shady thing?
eval       $args &gt;&gt; ~/snailsvndifftool.log 2&gt;&amp;1

However, doing eval on arbitrary arguments seems unnecessarily insecure and I couldn't get arrays to work (i.e., mvimdiff ${args[@]}), so instead I force mvimdiff to be at the beginning of the line and only allow a set of characters:
#!/bin/bash

args=$(grep opendiff &quot;$@&quot; | sed -E 's,&quot;/Applications/Xcode.app/Contents/Developer/usr/bin/opendiff&quot;,,; s/[^A-Za-z0-9.~/&quot;_ -]//g; s,^,/usr/local/bin/mvimdiff,')
echo diff: $args &gt;&gt; ~/snailsvndifftool.log 2&gt;&amp;1
eval $args &gt;&gt; ~/snailsvndifftool.log 2&gt;&amp;1

There's probably something I'm missing, so I hope someone has a better answer.