Or does Subversion hate iWork? I was just hit with the iWork/SVN bug that seems to be infamous among those using the two products concurrently. The problem, essentially, is the way that iWork—Pages, Numbers, and Keynote—and Subversion store their files. It’s well-known that, for some time, […]

Or does Subversion hate iWork? I was just hit with the iWork/SVN bug that seems to be infamous among those using the two products concurrently. The problem, essentially, is the way that iWork—Pages, Numbers, and Keynote—and Subversion store their files.

It’s well-known that, for some time, Apple has chosen to package certain files as bundles; they appear in the Finder as single files, but from the Terminal and the file system proper, they are directories. Subversion (SVN, the popular version control system), like CVS (Concurrent Versioning System—another, earlier versioning system), stores its state files containing information about the current revision, the main repository, and so forth, within special directories inside each directory under Subversion control.

I have been using SVN to manage revisions of my writing—a prudent thing, you might agree, as it is both easier and more robust than the “track changes” feature of Pages (or Microsoft Word, for that matter). However, the problem lies in those .svn subdirectories that are part of every directory under Subversion control.

When Pages (or Numbers or Keynote) saves a file, it appears to do so by completely overwriting what is already present: the .svn directory is erased in the process. Attempting to commit those changes to the central repository for safekeeping illustrates the problem:

SVN failure

Files (directories? bundles?) are therefore left high and dry, and the entire point of revision control becomes moot. Since iWork does not support built-in revision control (unlike Microsoft Office), utilities such as CVS or SVN would be the next best option—if they weren’t cut down by the file bundle notion.

Ideally, Apple would decide whether file bundles—files such as applications, plugins, and iWork files—were actually files or directories and treat them as one or the other in all cases. It seems that file bundles are here to stay in their present state, at least for the foreseeable future, however.

While there are several workarounds [1][2], perhaps the most logical solution is to migrate from Subversion to a different revision control system that does not suffer this problem, such as Mercurial, Git, or GNU arch. None of these three keeps local state information within subdirectories of the working copy.

It is unknown whether other bundle-type files are susceptible to SVN and CVS impotence.

You’re subscribed! If you like, you can update your settings

  1. I have been looking for a solution to help keep me and other members of a creative project in sync and safely backed up. Subversion might be a decent solution for this, but I really have no idea how to setup either the client or the server. Sounds like you have experience with it though so maybe you should put together a how-to article covering Subversion from the perspective of a Mac user wanting to use it to do versioning and syncing of general files (mostly RTF, JPEG, and PSD in our case). Most of the stuff I have seen mostly covers setting it up to work with stuff like XCode.

  2. Try svk. It’s an alternative front end to Subversion that adds distributed operation and a few other cool things. It doesn’t create .svn directories in its trees, so it should be more friendly with iWork, and it’ll work with your current SVN server.

  3. You could use svk, which builds on subversion (so can use your existing subversion repos and has a familar command set). It also gives you offline VCS functionality which is really useful to me.

    As a side effect it does not put any additional data into the working directory.

    Mac installers are available, or it can be installed using the MacPorts port command.

  4. @Twist — That’s a great idea. I’ll work on that.

    @Scott and Nigel — I saw that svk would overcome the problem (after writing this article), but I’ve actually already migrated to Git. As I’ll point out in the article I put together at Twist’s suggestion, Git actually works better for my needs anyway because there is no central repository.

  5. I just wrote about this and my frustrations with Subversion. It’s not unknown whether other bundle-type files are susceptible – all the ones I’ve tried are in fact susceptible.

    Because of this issue, I’m thinking about setting up Git as my solution. Billy, how do you like Git so far?

  6. Billy – you’ll love git. I just switched all of my projects over last month. As soon as I saw your article in my RSS reader, I thought git! You beat me to it.

  7. Try using another version control system, that doesn’t pollute your repository by scattering its meta information across the whole directory tree: Mercurial for example (which has lots of other benefits over svn BTW… :-)

  8. @Brian and Chad — git was very easy to compile and install. (A dream, in fact, compared to some packages I’ve pulled out my hair over.) I usually like to compile all my own stuff, and I don’t use MacPorts or Fink, but git gave me no problems at all.

    Thanks, Brian, for filling in the blank on other file bundles. I wasn’t sure about those.

    If anyone is interested in a precompiled version, I can tar/bz2 my compiled version of git (for Intel, built with gcc 4.2.2, optimized for Core 2 Duo).

    @jojo — What do you like specifically about Mercurial? I chose git primarily because it was originally the work of Linus Torvalds and easy enough to migrate from SVN.

  9. Forget Subversion. Use Git or Mercurial instead. They’re much better and DVCSs are the future anyway.

    @Billy Halsey

    Regarding comparing Git and Mercurial.

    For me, their differences conceptually and performance-wise are insignificant. If you learn one you can apply your knowledge easily to the other.

    Mercurial is fast, but Linus claims Git is faster. That would make sense since Mercurial is written in Python and Git is mostly written in C. But the speed difference is insignificant to me and the size of projects that I work on. Mercurial is fast enough.

    There is a Git-SVN tools which lets you translate between Git and Subversion. I’ve read developers needing to commit to Subversion but wanting to use a DVCS really like this tool. So Git converts some developers for this reason.

    On the other hand, Mercurial converts Windows developers more easily, because Mercurial works with little hassle on Windows and Git doesn’t.

    I don’t like the fact that Git installs 146 scripts and executable binaries in your system. That’s way too many, but I’ve read that they’re addressing this issue.

    I know Git will get more attention from the Linux community and so the Mac OS X community (which I work in) will be better served if there’s competition. For example, Mercurial can plug-in to TextMate which I use for my Rails development. A Git plug-in for TextMate doesn’t exist yet.

    2008 will be an interesting year to see where DVCSs advance. It’s too early to say which, if any, will win, but I hope they tie.

  10. @HG — Thanks for the summary. I noticed the overabundance of git-* scripts in /usr/local/bin and was a bit taken aback, but if it works, hey, it’s an improvement over Subversion.

    Perhaps I’ll work on a TextMate plugin for Git. Had I even thought to check TM support, though, I probably would have chosen Mercurial, even though I usually manage my revision control from the terminal anyway.

Comments have been disabled for this post