My parents are using Git. Only, they don't know it. They use Apple's Aperture, a professional photo management tool for the Mac. But one point of irritation is that if you go and set up a bunch of printer presets on one user account, you then need to do it all again for the other account. Having a geek nearby helps with this sort of thing, especially if they are proficient in that Satanic language called AppleScript, and with some non-shitty languages too.

Here's how you do it - turn the application's preference folder into a Git repository (in this case, ~/Library/Application Support/Aperture - note the space!). Then you need a pretty interface - because non-programmers don't use the command line. This is where CocoaDialog comes in. It's a really simple utility you can invoke which will let you get user input. Fire off a little thing for a textbox to get the commit message, then pipe that back to Git. I used Ruby as my glue language, but if you are so inclined, you can use any scripting language - Python, Perl etc. If you are a Mac programmer, you could build your own interface on top of Cocoa and Objective-C. Static typing makes me say "meh", so I used Ruby. Which is fine, since Ruby is sexier than your programming language of choice.

The rest then is pretty easy - make it so the person can trigger the AppleScript in whatever way seems sensible - from the Script Menu, from Quicksilver or LaunchBar or whatever else you can think of.

Then you set up a cron job to 'publish' the git repository, which is as simple as copying it to a public location - I used /Users/Shared/ - and then set up another cron job for each user to do a git pull from the repository. You now have a one-to-many preference sync system. Why not just use a script to copy the files over? Well, you can use .gitignore on each repository, thus keeping some of the preferences separate (in Aperture, you may want to sync the print and export settings, but not, say, metadata or keyword settings). And you get the advantage of having a full change history - meaning if a person screws up their preferences, it is possible to just revert them.

If you want to do many-to-many sync, it’s actually extremely difficult in this scenario. Despite the fact that Apple’s property list format is all XMLish (although it uses element sequentiality rather hierarchy than to mark relations, which is somewhat demented), the printer preferences for Aperture are actually stored as binary-in-XML. I know. It makes me want to smash my head against the desk in sheer frustration. The binary format makes doing hand-merges a pain in the arse. It’d be possible to write a way of merging the relevant property list files, but it’s something I’d rather avoid.

Does this need Git? Well, no. You could use CVS, Subversion, Mercurial or Perforce if you like. Git adds nothing special, except for the fact that it’s made of unadulterated win - and it’s the version control system that I now have burned into my brain. That and the repos are tiny, checkout times are really fast and so on. 