Make opendiff wait for FileMerge to finish

Feb 23, '07 07:30:00AM

Contributed by: Lliwynd

opendiff is a command line app for merging text files. It is installed when you install the Xcode Developer Tools on Mac OS X, and calls FileMerge.app. By default, opendiff does not wait for FileMerge.app to finish before exiting. This makes it hard to integrate opendiff with other Unix tools. After some searching, I found a solution.

In particular, opendiff will wait if the output is piped somewhere. I handle this by making a new shell script I call opendiff-w with the following code in it:

#! /bin/zsh
`/usr/bin/opendiff $@`
Then you can use opendiff-w just as you would opendiff, but it will wait until you quit FileMerge.app before continuing. It would be better still if FileMerge had a way to know when the diff was done without having to actually quit the app. Any suggestions?

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070220223441729