Setting up a SVN repository on the CAE (engineering) machines

If you are like me, the thought of having to do a group project without any version control is not appealing. Setting up a repository on the CSL machines is simple, because they have AFS. It's actually fairly simple on the CAE machines as well, once you figure out how to do it. Since that took me a while, I'll put the instructions up here for anyone interested.

Step 1: create the repository.

svnadmin create <reponame>

Step 2: create a unix group for your group members. CAE has a guide to unix groups, and you will need to go to the CAE account management page and create a new group (Groups->create a group). Add the members of your group, log out, and then wait 10 minutes for it to take effect before logging back in.

Step 3: change the group ownership on the repository.

chgrp -R <grpname> <reponame>

Step 4: make sure that the group can actually access your files.

chmod -R g+rw <reponame>

Step 5: set the group id bit for directories. You might be tempted to think that the above steps are sufficient, but whenever one of your group members commits, several files are created. These will use your group member's default group, which is private! To avoid that problem, set the id bit so that all files inherit the group from their parent directory.

find . -type d -exec chmod g+s {} \;

Step 6: make sure the path to your repository is accessible. In this case, I just made my home directory world-readable and executable.

cd; chmod 755 .
If you are slightly more paranoid, you can also just give executable permission to the directories in the path. This will prevent people from listing the directory, which is handy if you don't want people seeing your file and directory names. Since my directory only contains the repo, I didn't care.

Step 7: Test it out! Make a commit, then see if one of your group members can check it out. Then have them commit and try updating.

Last updated 8 July 2014; Corrections to step 3 thanks to Akshay Kumar.