Subversive Collaboration
Last time I co-wrote a book, Gina Smith and I holed up in a hotel room for a week, laptop to laptop, banging out the text. I know what you're thinking, but the only steam was coming off the keyboards. There just wasn't a better way to collaborate on a book.
Fast forward 11 years and things are a lot different. Web 2.0 sites like 37Signals Backpack and Writeboard are designed for large, dispersed groups working on the same project. Wikis make it easy for groups to share information and collaborate on documents. I'm familiar with these solutions - we've been using a wiki to produce Call for Help for the past two years - but none of these are just right for writing.
Adam Engst of TidBits and Jason Snell of MacWorld Magazine obviously recognize the problem. They've issued a joint RFP for a collaborative editor worthy of the Mac. The article's worth reading for a list of programs they've tried and abandoned, but I think I might already have the solution.
I'm interested in the problem because I've decided to collaborate on another book. Amber MacArthur and I are working on a podcasting how-to. We want to write the definitive volume on creating your own audio or video show, covering everything from content, to production, to distribution, to making money. Between us we've learned quite a bit about the process - often inventing solutions to problems as they came up. Inspired by 37Signals's success with Getting Real, we plan to self-publish as a PDF, possibly with a printed book or CD-ROM version from Lulu. But before we sell it, we have to write it.
Amber's in Toronto. I'm in California. How can we work together without spending a week in a hotel room? And what about other authors we want to bring on for specific chapters? How do we incorporate their contributions?
Open source programmers accomplish the task very efficiently with version control systems like CVS and Subversion. Why can't we? (OK it might not be as much fun as holing up together at the Drake, but it's a lot less likely to cause problems with our respective significant others).
I've set up a Subversion server on one of my less used systems. It took about 10 minutes using a Red Hat RPM and the daemon version of the svn server. I've never used Subversion, or any version control system, but there's an excellent, free, Subversion book that showed me what to do.
- I created a temporary document folder on my local hard drive with sub-folders for the book's sections and individual text documents for the chapters (mkdir tmp/thebook, etc.)
- created an empty repository on the server side (svnadmin create repository/thebook)
- edited the repository's configuration files to make it private and added accounts and passwords for Amber and me (vi repository/thebook/conf/svnserve.conf)
- uploaded the local copy to the server (svn import tmp/thebook svn://svnserver.com/thebook -m "initial import")
- checked out the server's copy to my local hard drive and deleted the temp doc folder (svn checkout svn://svnserver.com/thebook)
From now on my work flow is to:
- open Terminal and update my local copy with any changes from Amber (svn update ~/thebook)
- write a bunch of stuff
- open Terminal and save my changes back to the server (svn commit ~/thebook -m "notes for the log")
That's if I want to do take the trouble to open a terminal window - but as you'll see, I've found a text editor that eliminates even those simple steps.
Subversion can handle binary files, including Word documents, but I think we'll probably use a plain text editor since books don't typically use Word style formatting. (Publishers use codes much like the old Wordstar dot commands to indicate formatting.) There's a binary distribution of Subversion for OS X. I installed that on one machine. I used Fink to install svn on another Mac. And used Ubuntu's application installer to put it on my Linux box. There's a Windows client, too, although I haven't tried it. I've been able to easily checkout the document tree on all three machines, update it on each, then commit the changes back to the svn repository on the server.
It works flawlessly with one exception. I have had some problems with Mac files that have data and resource forks. svn doesn't see the resource fork so it munges the file. For example, I created a pair of Applescripts to automate the update and commit commands, but they didn't upload properly. The solution was to zip them first, but that's a gotcha for Mac users.
I've written up some simple instructions for Amber. It might confuse a less technically-proficient co-author, but she's very adept with these kind of things. She's going to install it tonight. I have high hopes. Subversion will allow us both to work on files locally (that's why I rejected Backpack - I didn't want to work only online), but makes it easy to update the server, and is great for backups because Subversion keeps all previous versions of all documents. If we happen to make conflicting changes to the same document, Subversion has good tools for merging the changes and figuring out what to keep.
The final piece of the puzzle is Textmate for the Macintosh. Textmate has built in support for Subversion. I can load the entire document tree as a Textmate project, easily add or move files, add text, and so on just by hitting Control-Shift-A in this very capable editor. This setup fits my ADD style of writing: A little here, a little there, iterating over the entire text as I think of things.
Textmate and Subversion are tools designed for programming teams, but there's not much difference between those teams and book authors. I'm thinking this will be a truly useful way to collaborate, and since we want to write the book in record time, it may be the only way to get it done.
I'd love to hear how other people are solving these issues, and suggestions you might have for making this setup better. We'll let you know how it works as the book progresses.
Comments
Leo, you are on the path to collaborative zen. Be sure to check out the 'blame' command if you need some ammunition against Amber messing something up :)
http://www.codingmonkeys.de/subethaedit/
SubEthaEdit's a decent app, but it's designed more for real-time editing, and doesn't have the versioning capabilities of Subversion. From what I see of your setup, you've pretty much got it made! :D
Is it just me or does everyone elses eyes bug out with this white on black layout?
Anyway, Leo I just don't understand why you felt such a need to work offline on a project like this. Rejecting a program like backpack, simply because its online only doesn't make sense to me in this day in age.
Wifi is everywhere these days, especially in the big cities you frequent and live near in CA and Canada. So I guess my question to you is really, why not?
Other than that, setup sounds good, hope it works out for you. You know I've been wanting you to create a podcasters guide for sometime now, and I'd be sure to pick it up off Lulu if printed.
How fast you talking here? 2 weeks?
I don't see why subversion couldn't handle what you need to do. Worst case should be writing a plugin for the text editor you want to use.
This sounds like a really good set up though, and could definately get more people using cvs, making it easier (and hopefully more likely) for people to collaborate on projects more often.
On another note, I love what you did on TechTV, and miss it very much. Hope you don't mind I added you to my friends.
Wow, sounds like a very flexible way to collaborate. Think it might work for screenplay collaborations? I know that in the past that has always been a highly collaborative process in which we wound up with of volumes filled with a rainbow colored set of pages.
By the way, thank you for the Lulu update. I've been looking for a good online way to receive print-on-demand without employing a site like Xlibris (http://www2.xlibris.com/), which allows some online control but eventually reverts to standard publishing protocol of the older days whereby you still had to ship your manuscript into them in order to receive a per unit production quote.
RE: why not just do it all online?
There are a couple of reasons why an online only system like a wiki or Backpack wouldn't work for me. First, the only copy of the work is on the online system. If the server dies, or the company goes belly up, so does your book. With the Subversion system there are complete copies of the book (and ALL previous versions) on every system we use. Even if I weren't collaborating, I might use svn for this reason alone. I am paranoid about losing my work when I write. svn is better than backups, since it keeps everything.
Second, online-only-editing is inconvenient. For example, I like to write on planes. It's much easier to have a complete copy of the book on my hard drive, work on it on the plane, then update the server when I land. svn means I have a complete copy of the book on my hard drive, and on a server. And my co-author can easily get all my changes on her local copy with a single command.
It's also true that the web based editors aren't nearly as powerful and responsive as the local editors. Textmate is highly scriptable and fast. It's a much easier way to write, for me, than in an online window, no matter how much Ajax goodness there is.
I use Subversion to keep my documents sync'd between my laptop and desktop and it rocks. Of course, I'm a programmer so it was a simple choice for me, but I think that someone (hmm...I smell a project coming on) could easily wrap Subversion in a user friendly system and create a "consumer" version control system thats much easier to use.
Version Control is not just a programmer thing, we all have documents that we want to either a) collaborate on with others or b) keep track of all the changes so we can go back to any version or c) both! Version Control systems like CVS and SVN are great for that.
P.S. Leo, actually I think the only place with every previous version is the Subversion repository on your server, the other computers have only 2 copies: The one they downloaded from the server last (in that .svn folder in the working copy) and the one you are using as your working copy. At least in the standard configuration, I may be wrong.
RE: Andrew's comments
Good point - only the server has all versions. I'd better make sure the server copy is backed up regularly.
I wonder if it would be desirable to use cron (or the ugly OS X replacement, launchd, which I've yet to truly master) to automate the commits and updates. I prefer to do it explicitly, but in a backup system like yours automation might be a good idea.
I use Subversion quite often and I think it is the best version control out there. Just an interesting fact, it was leaked to me that while Microsoft just released there new version control software most of the project teams still use subversion, hmmmm. Any way Neumont University, my college, uses subversion for all of its projects classes. Students that are incapable of using subversion correctly will swear up and down that subversion sucks but I believe that Subversion rocks.
Glad to see you on Vox! I am a big fun and watch you daily on TechTV here in Toronto since you the Screensavers!
As for the windows size, you may want to consider TortoiseSVN, a Subversion client intregrated into the windows shell (*groan*) right-click menu. It's so easy to use that we even have our most non-technical artists at the studio here using it.
As for backing up, we use FSFS repositories on the server here, and it's generally simply a matter of copying the files. If you use BDB repositories, you have to use a hot-backup script (included with most SVN distributions). I simply back up to a large usb hard drive, and swap it out to a safety deposit box.
And to add to all the fun, you may want to consider checking out Trac. It bills itself as a bug-tracking system for svn projects, but it also contains a wiki, tasks, messages, milestones, etc, etc. It's considerably more complex to set up, and a bit difficult to use (at least, for some of the aforementioned artists), but it may fill in some of the holes.
Great input, Twitch. I'm off to check out Trac. Thanks!
"Amber MacArthur and I are working on a podcasting how-to."
Yay! You are the perfect people to write this book. I can't wait to buy it.
Oh, by the way, the only reason I found Trac, was that it is (was?) used by 37signals internally for their own bug tracking. I found out about 37signals via ITN. The IT community is so incestuous.
Now, I have a question for you, Leo. In all your searches, did you find something that would allow collaborative editing of layered text and graphics, for a webcomic? I'm currently using a wiki with a friend of mine to do one, but it's doesn't feel as easy as it should be. I'm currently entertaining the idea of using a combination of Flash, Subversion and text files, but it seems a bit like swatting a fly with a sledgehammer.
i've been considering using subversion like this for some documentation i'm writing at work. did you choose fsfs or bdb?
Most of this stuff about CVS and Subversion is way over my comprehension level but one thing for sure is I look forward to this "Podcasting How-to" book to come out. Im quite sure with Amber also working on this project, it will be a hit.
So your doing tutorials again I see. ;)
By the way, LuLu is kick'n!
Can't wait to see it man.
FSFS - thst was the default so that's what I used. After having read further about the pros and cons of DB I'm glad I chose FSFS. It's not exactly a demanding environment anyway. There are only two of us using it (maybe more as we get closer to publishing).
This sounds like a great collaboration system Leo -- please keep us posted on how it works out for you (and any tips you find out along the way). Thanks
Can't wait to read this collaboration! I'm a big fan of both your and Amber's work, all of the podcasts you are involved with are so well produced.. 'crisp' is the word that comes to mind. This will be a great contribution to the podcasting community.
On another note, um, remind me again why its a bad thing to be holed up in a hotel room with Amber Mac?
My wife and I are very interested in trying our hands at podcasting. Please keep posting as you progress and consider me one of the first in line to purchase your latest book!
I thought about writing something similar a few months ago but realized how niche it would be. If you're interested in any of my experiences doing Hak5 in text form hit me up.
my programmer friend uses tortoise SVN and subversion on our intranet site at work... good tool. If I knew you were looking for something like this I would have recommended it.
Just a note for people who haven't used a source control app like Subversion or CVS before - they can only merge changes in text files. That means no merging changes for Word documents in particular. Instead when you update from the server, your file will be renamed and the new one will be put in its place (only in the case where a merge would normally occur).
Off topic, but make Patrick Norton blog. I added him to my neighborhood, but he hasn't posted anything. What's going on with him now a days? I miss the Screen Savers.
www.dl.tv is where Patrick is at these days.
Leo, any updates on the progress of the book? I'm so anxious to get it!
Invariant - not true. Subversion can (and does) merge binary files. It only runs into problems when the same area of the file has been changed by multiple people. For instance, if you checked in a bitmap file with a change in the top-left corner, and I changed something in the bottom-right corner -- it would merge properly. Of course, this is highly dependant on file format. Word format is pretty lousy for it.
The renaming you're talking about is Subversion's way of non-destructively allowing you to handle a conflict (local and incoming server changes in the same part of the file). If you're working with files that are difficult to automatically merge, you may want to consider using Subversion 1.2's file locking features.
More binary file details in the FAQ
twitch, I stand corrected. CVS and other source control programs don't support binary merges at all. As you mentioned, even when it is supported results may vary depending on the file and changes made.