<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I have a follow-up to Aparajita's recent thread about adding FileMerge support to TextMate. I really like the idea, but as Chris pointed out, it shouldn't be necessary to clone the Subversion bundle or add special environment variables to TextMate. That's because Subversion isn't hard-coded to use diff; it can run any utility you want, as long as its arguments are diff-compatible. All you need to do is add a diff-cmd setting to ~/.subversion/config.<DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-style-span">The problem, though, is that TextMate <I>is</I> hard-coded for diff. If you look at the svn_diff.rb file in the Subversion bundle, it forces svn to run diff instead of the user's diff-cmd. I think the best solution, then, is to change this file so that it's not hard-coded. Not only would this add support for FileMerge [1], but it would add support for any other diff utility, as well.</SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-style-span">With that goal in mind, </SPAN>I've modified svn_diff.rb and posted my changes here:</DIV><DIV><A href="http://vocaro.com/trevor/files/svn_diff.rb">http://vocaro.com/trevor/files/svn_diff.rb</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>To try it out, simply replace your existing svn_diff.rb with this one. You'll then be able to specify a custom diff utility by setting the diff-cmd variable in ~/.subversion/config [2]. The next time you run a Subversion diff command, TextMate will automatically run your preferred diff utility. If you comment out the diff-cmd line (or delete the config file entirely), TextMate will go back to using the standard diff utility as before.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-style-span">The only functional change here is that if you specify a custom diff-cmd and a file has no changes, you'll see no output when doing a diff on it, not even a tooltip [3]. The problem here is that with the regular diff, no output means no changes, but with custom (graphical) diff utilities, usually nothing is printed to stdout, even when there <I>are</I> changes. So, the command can't simply look at stdout and know whether changes were detected or not.</SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>With that caveat, I hope some of you can try this out and let me know what you think. I'm hoping that with the proper vetting it can be checked into the repo. After all, it's a pretty low-impact change. No new bundles, no new commands, just different behavior when specifying a custom diff-cmd. (If none is specified, TextMate works exactly as it did before.)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Trevor</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[1] Unfortunately, opendiff (FileMerge's command-line launcher) is not diff compatible. You'll need a wrapper script like this one: <A href="http://vocaro.com/trevor/files/filemerge">http://vocaro.com/trevor/files/filemerge</A> (It's buggy, though. Although it works great for diffs against BASE, whenever the network is involved, such as diffs with HEAD or PREV, it sometimes works, sometimes doesn't. Can anyone help?)</DIV><DIV>[2] I've posted an example config file here: <A href="http://vocaro.com/trevor/files/config">http://vocaro.com/trevor/files/config</A></DIV><DIV>[3] When no custom diff-cmd is specified, you'll get a tooltip that says "No differences found."</DIV><DIV><BR class="khtml-block-placeholder"></DIV></BODY></HTML>