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!
15 Comments
So, if you disable bundles, can your Graffle files still contain embedded images?
Absolutely! They’ll end up as base64-encoded (I believe) blobs in the XML file.
Thanks for the blog on this. This has actually been really frustrating to deal with and I’m glad to see there is such a quick fix for Omni Graffle. Do you have any idea’s on a more general solution? Bundles are pretty common in OS X and subversion will be propigating the .svn directories throughout these bundles.
Thanks again.
Hi Max. I’m not sure what the best general solution for this is. One thing to try, if you’re writing a bundle-based application, is to replace the contents of bundle documents instead of deleting them and starting over. Apparently Keynote 2.0.2 is doing this now. You’ll still have to manually add new files, of course.
I think this sort of issue shows that putting a special directory in each subdirectory of a checkout, like CVS and Subversion do it, is not the best idea. Some other version control systems use a single directory at the top of the checkout. SVK, my version control system of choice (though of course I use Subversion too) can keep metadata either centrally in your home directory or at the root of the checkout.
There are certainly folks working on Subversion who think that Subversion 2.0 might want to drop the metadirectory-in-every-subdirectory shtick…
This rocks! Wish I would have googled this before I spent an hour wrestling with various forms of SVN trickery trying to get the graffle files to check in.
Thanks so much.
ps. The OminGrafflePro syntax works.
Great tip, thanks. I just ran into this problem and your post completely solved the problem.
Woo Hoo!!!
I finally decided to Google this issue and this post was the first thing found. Thanks! This really saved my butt.
Extremely helpful. Thank you.
Anyone know if there’s a modified command like this that will work for other Omni products like OmniOutliner?
Gave it a try and the OmniGraffle pro syntax works. I’m having trouble converting existing files, though. Even resaving an existing file as a new one doesn’t change the file from a package back to a single file. I actually have to create a new file and manually drag the pages into the new file and save that. Anyone have any luck with this?
Also, one note: Make sure you convert your template files to single files. If they are packages, then when you create a new file from a template, it will start out as a package.
For those who missed this in OmniGraffle 4.2’s release notes, there’s now a document settings inspector which which shows document creation and change information, allows file compression, and specifies whether the document should be saved as a flat file or file package. (You no longer have to go hunting for that hidden default!)
Hope this helps!
Thanks for adding that, Ken!
Of course, now my blog will have zero useful blog posts instead of one.
I found the easist way to convert an existing document was to export to a new omnigraffle doc. That dialog box let me select the format
Yes, thanks Ken! That setting saved me hours of heartache.
This fix didn’t work for me with:
Product: OmniGraffle-4.2
Tag: OmniGraffle_4_2_2
Date: 2007-11-20 13:32:33 -0800
2 Trackbacks/Pingbacks
[...] Posted by skeptomai Fri, 15 Jun 2007 15:21:12 GMT Like all good Mac people, I do my diagramming in OmniGraffle. I just upgraded to the most recent Pro version and started creating new diagrams for a project at work. I went to check them into our Subversion repository and…. crap. My “graffle” files were now directories and the Icon file has a carriage return in its name. Subversion not so happy. Fortunately I’m not the first to have encountered this. Here’s a note from David Glasser’s blogJust 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 This will make OmniGraffle make all future files as the flat-file format and never sneakily turn into bundle format. Hooray! ..and there are numerous threads about this if you Google them out. I haven’t tried this tip yet, but wanted to get it into the blog before I forget it. [...]
[...] floating point » Blog Archive » Using OmniGraffle with Subversion without Sadness (tags: omnigraffle subversion osx svn mac) [...]
Post a Comment