Personal version control

2006-09-07, , Comments

We all know that version control isn’t just for source files but opinions differ about what should and shouldn’t be checked in. Can something be too large for version control? Too immutable? Conversely, something be too small? Too transient?

Large Things

Most of the arguments concern large items: should we check in the compiler (plus patches); the JDK (including source code); the high definition video files used for test purposes; third party RPMs used to build the CD ISO image? Surely (one side of the argument goes) we don’t need to version control these huge assets which don’t/can’t change — we should just burn them to DVD and keep them safe? Surely (the counter-argument goes) we need to keep track of everything our project depends on, and that’s what version control systems are good at.

Both arguments are reasonable and a solution must be found somewhere between the two. Clearly we can’t version control everything since we can’t version control the version control system.

My inclination is to use version control as widely as possible. It’s well suited to managing documentation for example. A decent version control client should impose no overhead — making it as easy to check a design document into version control as at is to copy it into a shared folder.

Small Things

At the other end of the scale, what about the small, transient, personal things? I’m talking about hidden resource files: your .bashrc, your .emacs, your eclipse configuration, your personal cronfile.

In my experience, these files very rarely get placed under source control — and I can’t understand why. I often tweak my resource files. I want to be able to wind back these changes, if necessary. I want these files backed up as carefully as project source files since they’re an integral part of my development environment. Putting these files under version control also means that setting up my preferences on a new platform can be accomplished with a command as simple as:

svn co svn://<svnserver>/personal/tag/home .

What’s more, when you start treating your personal environment as something deserving version control, you find it becomes better organised. Those baby throwaway scripts — which you wish you hadn’t thrown away — instead grow up and develop options and usage help. Tiny experimental test programs find a home. Even your directory structure becomes less muddled (assuming you use a version control system which allows you to move files and check in soft links).

Subversion even allows you to check in soft links.