Mac OS X and Subversion

Non-geeks can skip all of this!

Subversion is a very nice version-control system which fixes many of the problems with its predecessor, CVS. You can use, for example Martin Ott’s packages to get an up-to-date copy for your Mac. There’s some support for it in XCode, and in general it works very nicely on the Mac as long as you don’t mind using the command line. I haven’t found a Mac GUI for it yet that I like; the best is SvnX and frankly, that’s not saying much, though I applaud Dominique Peretti for doing something.

Anyway, there is one thorny issue on the Mac. Many things which appear to be files in the Finder are in fact directories – ‘bundles’, they’re officially called. In the past, they were mostly just used for applications, but an increasing number of document formats are now bundles as well. Apple’s Pages and Keynote packages are examples.

When you check a directory tree out of Subversion onto your local disk, a hidden ‘.svn’ directory is created in each directory in the hierarchy. That’s where subversion keeps its stuff. Having this in a document bundle does not upset an application; they normally just ignore it. But some apps assume (reasonably) that they’re the only ones interacting with the bundle. If you open a document in Pages, change something and then save the doc, it will overwrite the directory with a new one and in the process delete and .svn directories within it, which will confuse Subversion if you then try to check it back in. The latest version of Keynote doesn’t do this; it reuses its old directory, but it’s unusual in that respect – most things which create bundles will cause a problem if that bundle is managed using Subversion.

There are manual fixes for this (see ‘Things to watch out for’ at the bottom of this page, for example), but it’s very inconvenient if you do this often. Especially if your bundle includes multiple subdirectories because you’ll need to do it for each one.

Probably the right way to fix this is for Subversion to be able to view certain directories as untouchable, and store the information about them within the .svn directory of the parent. An alternative would be to tar and un-tar all such directories behind the scenes and check them in and out of the repository as if they were a single file. I discovered a thread from about three years ago discussing this, but I don’t think anything was done.

I’m really hoping that Apple, having made a major step forward in file systems by making them searchable, will be the first to introduce decent version control at a fundamental level. Well, the first since VMS, anyway.

Enjoyed this post? Why not sign up to receive Status-Q in your inbox?

Got Something To Say:

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

*

© Copyright Quentin Stafford-Fraser