Subversive behaviour

I’m a big fan of version control. I use RCS to control versions of files I’m editing on my machines, and these days I use Subversion (instead of the venerable, but less cross-platform and more annoying CVS) for version control on projects I’m working on.

I’m still learning about Subversion, annoyingly it seems you can’t check out a single file, which of course makes sense because it would then leave Subversion nowhere to write its hidden version information directory (I wonder if that’ll change with the advent of Subversion using a single file to store all its working copy information). I did try to ‘svn export’ a single file from the repository, but I got the error message “”.

Subversion does however have the ‘svn cat’ command, which dumps the contents of a file. So using the ‘power’ of unix you can pipe that file to a shell thus:

svn cat svn+ssh://username@example.com/SVN/trunk/evilshellscript.sh | /bin/sh

thus you could put some more svn commands in evilshellscript.sh and it could checkout more files from the repository, take over your machine, or do all sorts of nasty stuff. I use it to checkout and put some more files and put them in the right place.
My vision is of walking up to a pristine new Mac, entering one command, and having the machine download and install all the software I use and setting itself up just the way I like it.

Leave a Reply

Your email address will not be published. Required fields are marked *