Get Up 8

Userscripts vs. CVSweb

As mentioned before, I want to improve the way I was serving source files. An obvious improvement is to link together version control with distribution, and the obvious alternative was cvs and CVSweb. Because of recent changes, atalib, the greasemonkey script for adding WorldCat search results to Amazon pages, was an ideal candidate to try on the new arrangement.

Unfortunately, CVSweb is not well-suited to serving userscripts, and/or greasemonkey does not play well with CVSWeb. See, CVSweb serves up pages for URLs that end with the filename of the version controlled file, but the resource addressed by the URL is not actually the file, but a presentation of metadata for the file, version histories, branches, that sort of thing.

As a more concrete example http://cvs.ninthorder.com/cvs/atalib.user.js does not address the atalib userscript, itself, but the revision history as seen below.

Userscript vs. CVSweb

Here's where it starts to get rocky: greasemonkey believes that when a URL that ends with user.js is loaded, greasemonkey should intercept it and try to install it as a greasemonkey script. While greasemonkey is enabled, you can't even load the page that has the link to the actual greasemonkey script.

Which brings me to the next issue: The link to the actual script does not end in user.js, it ends in a revision number, so it will never be intercepted by greasemonkey to be installed.

I'm working on rules for mod_rewrite that will allow a URL of the form .../atalib.user.js to address a revision via CVSweb. That part really isn't that hard. Unfortunately, if you want to browse the CVS repository for a greasemonkey script, you're going to have to disable greasemonkey while you do it.

UPDATE: Jeff suggests that no one really wants to browse the revision history of my files. That might be true, in which case all I need is to expose a cvs checkout to the web. It's a thought I had last night, too, and it's worth further consideration.

UPDATE: Further, Jeff wondered why I was using 20th century technology for revision control. The answer was, I'm reasonably familiar with cvs and CVSweb. He says I should be using git because he and Linus both like it. I decided to scrap cvs for now and try bazaar for version control, because it provides many of the same features as git, and the Canonical people at PyCon 2007 gave me a bazaar t-shirt. (Commit. Push. Merge.)

Thu, 13 Sep 2007 08:53