OmniGraffle is an awesome charting and drawing tool. Subversion is a great version control system. Unfortunately, by default, they don’t work perfectly
together.
That’s because OmniGraffle has (at least) two formats for its files: a flat XML file, and a “bundle”, which is actually a special folder containing a bunch of files. By default, OmniGraffle makes flat files, but if you add an image to your document it will magically turn into a bundle and store the image in the filesystem.
If you’re using this with Subversion or SVK, this is a problem for at least three reasons. First of all, most version control systems don’t deal too well with files suddenly turning into directories behind their backs. Secondly, if you add more images, OmniGraffle will add them to the directory, but Subversion will have no idea that these new files should be under version control, and you’ll have to manually svn add them.
More annoyingly, the bundle format used by OmniGraffle puts a file in the bundle which sets the bundle’s icon, and the file is named Icon\r. With a carriage return in it. Yeah. I’m not sure what they or Apple were thinking (as far as I can tell this is one of many ways to set a document bundle icon and I can’t find other apps that use this one), but putting control characters like a carriage return in file names just sucks. And to tie back into the point of this post, Subversion just won’t let you check in that file.
There’s a solution, though, at least for OmniGraffle! Just type the following line in your terminal:
defaults write com.omnigroup.OmniGraffle PrivateGraffleFlatFile 0
(Or if you run OmniGraffle Pro, you apparently should do
defaults write com.omnigroup.OmniGrafflePro PrivateGraffleFlatFile 0
though I haven’t tested this.)
This will make OmniGraffle make all future files as the flat-file format and never sneakily turn into bundle format. Hooray!
