Off the Grid

If I ever got the chance to use Subversion on a large project, I think I’d branch my ass off. Here’s why:

Act 1, The Vacation
Imagine you’re 30% done with some changes to your project. You’ve done some good, but incomplete, work. Perhaps the code doesn’t even compile in it’s current state. Now you need to go on vacation. You can’t check in, because it will break the rest of the system. But unless you do something to backup your work, you risk losing it all in a hard disk failure.

Act 2, Two Roads Diverged
Back from vacation, and you now find yourself 50% done and facing a tough decision. You can think of two different ways to continue your implementation, and you’re not yet sure which is best. Again, you can’t check your half-done work into source control without incurring the wrath of the team.

The state of the art, at least in the places I’ve worked, is to solve both of these problems by going “off the grid”, and copying zip files around. Essentially this forgoes all the benefits of source control for the duration of the task.

The real solution to this problem is a the concept of a work-in-progress branch.

If each developer branches from the mainline before starting work, she can check in broken code at will, because nobody else cares about her branch. She can checkpoint her work, attempt something, and go back if she changes her mind. She can even branch her branch, if she finds herself truly indecisive. Additionally, she gets to put her important source code on a system with regular backups. Eventually, the WIP branch is merged into the trunk and left to wither and die.

Am I crazy, or does that just feel right?

Some of you may have a legitimate excuse for the off-grid behavior, like a poor version control system. None of this is really feasible unless you have extremely cheap branching, like Subversion’s slick copy-on-write system.

I suspect there are plenty of folks out there who are already using WIP branches (because I’m notoriously late to the party). I’d love to hear your comments.

Advertisements


%d bloggers like this: