I set up a Subversion server on the FreeBSD box a while back, then didn't do much with it until this past weekend, when Software Carpentry mentioned it.

I installed SmartSVN on the Ubuntu box and declared a new repository with a svn+ssh:// protocol. I figured it would make sense, since I connect to the server through a ssh tunnel with authentication key files. I was right. SmartSVN connected to the server without a hitch. Then I tried svn://, http:// and https://. None of them worked. The latter two require some extra module (WebDAV?) enabled in the Apache server. I don't know much about any of it, so I figured I'd just stick with svn+ssh:// and be done with it.

Then my first commit attempt promptly failed, with a message that a certain lock file could not be opened.

That looked like a file permissions issue to me. In FreeBSD, the /etc/group file lists the group names, ID's and members. I had a group named svn present already, so I added my name to the member list and saved over. Now whatever that group's permissions needed to be, I was going to be in on them.

Then, as root, I did this:

chown -R gabi:svn /usr/home/svn/repos

OK, so now I own the files in any sub-directories of the repository, and the group permissions will apply to the svn group. I set them like so:

chmod 775 /usr/home/svn/repos/hooks
chmod 775 /usr/home/svn/repos/locks
chmod 775 /usr/home/svn/repos/db

It worked. I could commit a folder with some example text file in it. Then I changed it and updated it, and then I made a different working copy and caused a conflict, so I would have something to resolve. All of that worked as advertised. There are a few things left to do, like branching, tagging, merging, and reverse and forward integration. I'll write more as I go through the learning process, but before I close this post I have to mention this neat little post. It's a better introduction to how version control works and why it's done than even Chapter 1 in the Subversion book, which is great, so that's saying something. Better explained, indeed. I'd never heard of them. All hail Google, again.

And now my Stata code can go under proper version control. Life's good.