CVS Lite: A Lightweight Alternative to CVS
January 2006 (master's student)
UPDATE on 2007-07-25
I've found a better version control system that now makes CVS Lite irrelevant. Please look into using GIT for source control for your future projects.
GIT was originally written by Linus Torvalds and is currently used to maintain the Linux kernel. Besides being massively scalable for real-world applications, it is also RIDICULOUSLY EASY to set-up and use for a small one-person project. Read this tutorial to find out how you can start up a GIT repository in less than 5 minutes. It was so damn simple that the first time I tried it, I couldn't believe my eyes! GIT completely solves the problem that I was trying to solve with CVS Lite (namely, CVS being too big and klunky to use to maintain version histories for small sets of files). Amazing!
CVS Lite is a lightweight version control system designed for simplicity and ease-of-use. I frequently use CVS on projects such as software and website development, but I find the overhead of setting up and maintaining a CVS repository too high for simply tracking versions of a single file edited by a single user (I can never quite remember the exact way to invoke cvs import).
Often times, I simply want to archive changes to a text file such as an essay or informal notes and may not want to bother setting up a CVS repository. CVS Lite excels at these small tasks. I have implemented the basic CVS commands that I find to be the most useful for a single-user system.
For instance, I can run cvslite.sh add on a file to create a repository in the same location as that file. I can then use commit to check-in new versions, diff to compare versions, up to retrieve old versions, and log to view my check-in comments. The lightweight representation of the repository (a tarball consisting of patches and text logs) enables me to easily move the file and repository around together or backup both using Unison or even the real CVS.
Quick Start Guide
Follow these steps to get started with CVS Lite:
CVS Lite Commands
These are the only commands that I have implemented so far. Trying any other commands or fancy options will probably result in your shell blowing up. Enjoy :)
cvslite.sh <command> <optional arguments> <filename>
Each invocation of CVS Lite takes at least 2 parameters: a command name and a filename (it can only operate on one file per invocation). Commands might also take arguments, which should come before the filename. Here are all the commands:
CVS Lite is implemented as a BASH shell script that invokes diff to generate patches that represent differences between successive versions of a file, patch to apply those patches, and tar to store the patches together (along with the original version of the file and text logs) in a tarball that represents a CVS Lite repository. There is one repository per file. All repositories for files in a directory are located in a CVSLite sub-directory located in that directory.
cvslite.sh - That's all, folks! Lightweight!
You will need a UNIX-like environment such as GNU/Linux, Mac OS X, *BSD, or Cygwin for Windows, the BASH shell, and standard UNIX tools that should come pre-installed on these systems. I have only tested on Ubuntu 5.10 so far, but it should be fairly portable. Please email me if there are compatibility issues (especially with non-GNU versions of tar, diff, patch, etc.)
cvslite.sh.cvslite.tar - If you are curious, save this repository file into a CVSLite/ sub-directory alongside cvslite.sh. You can then invoke CVS Lite on cvslite.sh (itself!) to view the version history of its own source code. Yup! Eating my own dogfood!
(To be done whenever I feel like procrastinating)
Last modified: 2007-07-25