I wrote a version-control system today. Yes, an entire VCS. Took me 14 hours.
Yeah, you’re looking at me like I’m crazy. “Why,” you ask, quite reasonably, “would you want to do a thing like that? We’re not short of powerful VCSes these days.
That is true. But I got to thinking, early this morning, about the fact that I haven’t been able to settle on just one VCS. I use git for most things, but there’s a use case git doesn’t cover. I have some document directories in which I have piles of things like HOWTOs which have separate histories from each other. Changes in them are not correlated, and I want to be able to move them around because I sometimes do that to reorganize them.
What have I been using for this? Why, RCS. The ancient Revision Control System, second oldest VCS in existence and clinging tenaciously to this particular niche. It does single-file change histories pretty well, but its UI is horrible. Worse than git’s, which is a pretty damning comparison.
Then I got to thinking. If I were going to design a VCS to do this particular single-file, single-user job, what would it look like? Hm. Sequential integer revision numbers, like Subversion and Mercurial used locally. Lockless operation. Modern CLI design. Built-in command help. Interchange with other VCSes via git import streams. This sounds like it could be nice…
Then, the idea that made it inevitable. “I bet.” I thought, “I could write this thing as a Python wrapper around RCS tools. Use them for delta storage but hide all the ugly parts.”
Thus, SRC. Simple Revision Control, v0.1.
This first version is a very rough cut. It does all the basic VCS things – commits, checkouts, diff listings, tags – but the implementation is fragile. The first other person to look at it has reported that it inexplicably fails when you set EDITOR=vi. (UPDATE: This is already fixed.)
Still…read the manual page to see where it’s going (I wrote the manual page before the code). Most of the UI is shamelessly swiped from Subversion – I simplified where it made sense.
Yes, I will implement branching and import/export. There will be Emacs VC support, too. The overall emphasis will be on keeping it simple and light, a handy small tool for the jobs where a real VCS would be overkill. And if it goes sproing – hey, the masters are RCS files, you have an easy recovery path.
SRC – RCS as if user interface mattered. SRC – maybe Rome wasn’t built in a day, but this tool was. SRC – when you care enough to use the very least. Thank you, I’ll be here all week.
And if you’re thinking “Hey, that’s cheating! You didn’t really write a VCS, you let RCS do the hard parts!”, why, doing that is downright traditional. CVS was implemented – badly – the same way. But we’ve learned a lot in the quarter-century since, and know what mistakes not to repeat.