Skip to content

Using OmniGraffle with Subversion without Sadness

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

  1. So, if you disable bundles, can your Graffle files still contain embedded images?

    Friday, October 20, 2006 at 12:32 pm | Permalink
  2. glasser wrote:

    Absolutely! They’ll end up as base64-encoded (I believe) blobs in the XML file.

    Friday, October 20, 2006 at 12:43 pm | Permalink
  3. Max Matson wrote:

    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.

    Friday, November 3, 2006 at 7:40 pm | Permalink
  4. glasser wrote:

    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…

    Saturday, November 4, 2006 at 3:39 pm | Permalink
  5. 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.

    Thursday, December 14, 2006 at 1:51 pm | Permalink
  6. Masterleep wrote:

    Great tip, thanks. I just ran into this problem and your post completely solved the problem.

    Wednesday, March 21, 2007 at 12:37 pm | Permalink
  7. Eric wrote:

    Woo Hoo!!!

    I finally decided to Google this issue and this post was the first thing found. Thanks! This really saved my butt.

    Monday, April 9, 2007 at 9:29 pm | Permalink
  8. Extremely helpful. Thank you.

    Tuesday, May 22, 2007 at 6:24 pm | Permalink
  9. Michael wrote:

    Anyone know if there’s a modified command like this that will work for other Omni products like OmniOutliner?

    Monday, September 24, 2007 at 3:28 pm | Permalink
  10. Michael wrote:

    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.

    Tuesday, September 25, 2007 at 3:09 pm | Permalink
  11. Ken Case wrote:

    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!

    Tuesday, October 9, 2007 at 9:36 pm | Permalink
  12. glasser wrote:

    Thanks for adding that, Ken!

    Of course, now my blog will have zero useful blog posts instead of one.

    Tuesday, October 9, 2007 at 9:42 pm | Permalink
  13. seph wrote:

    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

    Thursday, October 11, 2007 at 1:51 pm | Permalink
  14. Ted wrote:

    Yes, thanks Ken! That setting saved me hours of heartache.

    Sunday, December 23, 2007 at 3:40 am | Permalink
  15. thijs wrote:

    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

    Wednesday, August 6, 2008 at 10:07 pm | Permalink

2 Trackbacks/Pingbacks

  1. [...] 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. [...]

  2. mcdave.net » links for 2007-10-09 on Tuesday, October 9, 2007 at 1:23 am

    [...] floating point » Blog Archive » Using OmniGraffle with Subversion without Sadness (tags: omnigraffle subversion osx svn mac) [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*