This repository has been archived on 2017-04-03. You can view files and clone it, but cannot push or open issues/pull-requests.
blog_post_tests/20141107013924.blog

15 lines
3.2 KiB
Plaintext

I wrote a version-control system today
<p>I wrote a version-control system today. Yes, an entire VCS. Took me 14 hours.</p>
<p>Yeah, you&#8217;re looking at me like I&#8217;m crazy. &#8220;Why,&#8221; you ask, quite reasonably, &#8220;would you want to do a thing like that? We&#8217;re not short of powerful VCSes these days.</p>
<p>That is true. But I got to thinking, early this morning, about the fact that I haven&#8217;t been able to settle on just one VCS. I use git for most things, but there&#8217;s a use case git doesn&#8217;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.</p>
<p>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&#8217;s, which is a pretty damning comparison.</p>
<p>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 <em>nice</em>&#8230;</p>
<p>Then, the idea that made it inevitable. &#8220;I bet.&#8221; I thought, &#8220;I could write this thing as a Python wrapper around RCS tools. Use them for delta storage but hide all the ugly parts.&#8221;</p>
<p>Thus, SRC. <a href="http://www.catb.org/esr/src/">Simple Revision Control, v0.1</a>.</p>
<p><span id="more-6502"></span></p>
<p>This first version is a very rough cut. It does all the basic VCS things &#8211; commits, checkouts, diff listings, tags &#8211; 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.)</p>
<p>Still&#8230;read the <a href="http://www.catb.org/~esr/src/src.html">manual page</a> to see where it&#8217;s going (I wrote the manual page before the code). Most of the UI is shamelessly swiped from Subversion &#8211; I simplified where it made sense. </p>
<p>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 &#8211; hey, the masters are RCS files, you have an easy recovery path.</p>
<p>SRC &#8211; RCS as if user interface mattered. SRC &#8211; maybe Rome wasn&#8217;t built in a day, but this tool was. SRC &#8211; when you care enough to use the very least. Thank you, I&#8217;ll be here all week.</p>
<p>And if you&#8217;re thinking &#8220;Hey, that&#8217;s cheating! You didn&#8217;t really write a VCS, you let RCS do the hard parts!&#8221;, why, doing that is downright traditional. CVS was implemented &#8211; badly &#8211; the same way. But we&#8217;ve learned a lot in the quarter-century since, and know what mistakes not to repeat. </p>