Tuesday, September 19, 2006

Subversion! Rocks!

I've been using subversion now for a few months and, quite seriously, I think it rocks.

I work at four locations (NASA, WVU, a workstation at home, and a laptop when on travel) and on three operating systems (Windows/Cygwin, OS/X, various Linux dialects). After some fussing with make files, I can know log in into any of the above, update, run a make file, and hey presto my local environment is up to date.

There are two cool side effects of the above.
  • Holy multiple redundancies Batman: I get back-ups on my stuff on multiple machines AND my central repositories.
  • I play well with others: If people want to run my code, its a few minutes set up and then they get my environment running on their machine. Better yet, by giving them access to the repository, we can all work together on the same project.
But there are some traps to avoid. Don't just jump up and rush home at the end of the day. Depart elegantly. Allow, say, ten minutes to shut down and commit your changes (subversion somethings needs a little babying to get everything squared away).

Also, the operating system does not know about subversion. Its so tempting to grab an icon in the visual environments and move some directories around. Don't do it. Every file/directory manipulation should be done using subversions. For example, don't "mv a b" but "svn mv a b".

Oh, and incrementally add little things every day- bulk huge updates are a real problem. So don't do what I did- try to import 4GB into the repository. Instead, having an "old" space and a "new" space inside the repository. If you start working on some "old" stuff, first move that directory/file into the repository and then "svn add" it. (By the way, its a little humbling how little of "old" ends up in "new").

But the main tip is to get a Dreamhost account and plant your repositories there. No set up headaches- repositories running in minutes. Files accessible via the web. And Dreamhost gives you lottsa disk space, for nearly $0. And you can set up any number of repositories there. I run three:
  1. http://www.unbox.org/wisp/: a space I share write access with my collaborators and the world can read it.
  2. http://now.unbox.org/all/: the world can read it but only I can write it.
  3. mine: no one but me can read/write it
That's all easy to manage. Just make a directory called "work" and install the repositories as sub-directories of work. A short script can then:
  • update with
    cd $HOME/work; for i in *; do (cd $i; svn update);done
  • commit with
    cd $HOME/work; for i in *; do (cd $i; svn commit);done
And the second script needs $SVN_EDITOR set to your favorite editor.

3 comments:

Anonymous said...

Tim, Tim, Tim... svn is so 15 minutes ago. If you like svn, git will rock your world. All the best things of svn, plus the ability to work disconnected and sync later means you can do checkouts on the airplane, have folks contribute ready-to-go patches to your repo, and lots of other things. For getting started with git, the cogito wrapper will make everything look fairly familiar and comfortable.

The Linux kernel developers originally built git for their work, but Nickle, XCB, and indeed most of x.org/freedesktop.org are there now. Check it out.

timm said...

hey bart,

so i looked up git in the fink package system and is this the one you mean?

"git: Stupid content tracker

This is a stupid (but extremely fast) directory content manager. It doesn't do a whole lot, but what it _does_ do is track directory contents efficiently. It is intended to be the base of an efficient, distributed source code management system. This package includes rudimentary tools that can be used as a SCM, but you should look elsewhere for tools for ordinary humans layered on top of this."

also, it ain't in the standard cygwin distribution (unless its buried away- like the way "convert" is buried away inside ImageMagic).

Anonymous said...

Not related, but in case you don't know this exists:

http://www.ratemyprofessors.com/ShowRatings.jsp?tid=171928

The link is three years old, btw. Just wanna share.

Somebody pointed me to this:

"Cheaply painted robot with no human subroutines."

which I think is the funniest line to describe a professor.

Hope you're doing fine. :-)

Eliza