Sep
24
2011

Why I Love CVS

It's All About Hack-ability Baby!

Saturday, September 24, 2011 - 02:03:36 pm
(Posted Under: Web Development)
Okay, so it's somewhat because I'm old school too. But it's largely because it's easy to hack a CVS repository to fix something stupid you did.

Case in point - I have a bunch of Photobox changes on a few different branches that I'm merging to trunk. I started doing that today, and once I got done, realized that on the third branch of four that I had merged, I'd omitted a single character that broke everything. Now, I really want that fixed on the source branch, as well as trunk. And for one character, having to do a second merge of that branch would confuse things down the track given the way I do things.

In all my years of using CVS, the extent of my hacking has been as simple as changing commit dates, or here and there modifying commit logs directly in the RCS file. On occasion I think I've screwed around with tags, but that starts to get into scary territory, and I'll generally restore a repository backup and redo whatever needs to be done via CVS in that case.

This has been the first time I've actually screwed around with hacking the contents of a commit. Because, admittedly, that has always looked scary. Making the one character change on trunk (head revision) was a piece of cake. Just make the change, as the head revision was basically the full file. Having that change reflected on the source branch didn't look as easy.

And wasn't, but after Googling the RCS file format, working out the diff syntax (ahhh, so that's what all those aXXX and dXXX's mean!) that RCS uses, and about 20 or so tries I got it working. Simply a case of specifying the right combination of lines to delete and add. CVS/RCS rocks. (Note, this was the only change on the file from the source branch to the HEAD revision, and probably wouldn't have attempted it otherwise).

And of course, my 20 tries to get it right was done on a copy of page.xsl,v. Because CVS is cool like that - if you want to screw around on a repository file, make a copy of it to another filename, hack away like it was actually part of the code base, and if it works, replicate it on the actual repository file that you want to change. If you can't do it, then just blow away the copy you made and everything is as if you didn't start hacking at all. I guess it's worth stating that I'm the only developer who works with these repositories, which is really what facilitates hacking to be feasible. Despite some minor draw backs of the flat files in CVS (the only one of note is the difficulty with renaming files), it's why I love CVS.

Anyways, this is a good reference for doing as such RCS Format - Open Source Development With CVS and was all I needed to work out how to do it. And thus concludes today's recount of hacking CVS repository files.

Oh, and did I mention that I backup all my CVS repositories nightly and before I start hacking? [wink] While the ability to hack CVS repositories is unparallelled, it's really easy to screw things up, and I can't even count the number of times I've borked the repository while trying to hack a fix to something. I never do it without a huge backup safety backup net.

But yeah, I love CVS for this reason.

Post Comment



All fields are required. Email addresses will not be published, but are required for anti-spam purposas.

Switch Styles

About Style Switching.

!Weblog Index

Aug September 2011 Oct
SU MO TU WE TH FR SA
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Categories

RSS FeedRSS Feed