 |
Subversion Rename Rocks!
Posted by joshy on March 24, 2005 at 07:03 AM | Comments (9)
I don't like revision control systems
I should start off by saying that I'm not a big fan of revision control systems. What I want out of an RCS is simple. Let me check files in and out so that my code is backed up and I can revert and merge as needed. I have found that branches rarely get used except in the biggest of projects. Though your RCS system can probably handle it, developers are still people and you can end up in a lot of trouble when you work on more than one branch at a time. Over the years I have used PVCS, RCS, Contiuum, Source Safe, Star Team (I think that was the name) and a few others. I keep coming back to CVS because it does exactly what I want (backup and store revisions of a tree of files) and does it with a few simple commands. It also has the advantage of being supported everywhere.
So, that said, I have always had two big complaints about CVS. First, I can't do anything when I'm not connected. I want to be able to get the status and add and delete files when I'm flying from Altanta to California. Only when I actually want to commit should I need to be connected to the server. Second, I want to be able to move and rename files and directories. This really isn't asking much, but it's something I've had trouble with in virtually every system I've ever used. They seem to assume that once you've gotten your code heirarchy set up you will only ever add to it. That's just not realistic in the short or long term. In the short term you are playing around and trying different things. Your code base is fluid, and I need a tool that is fluid with me. Once it settles down you are pretty good, but then eventually you have to make wholesale changes farther down the road. In the long term you need to be able to rename and move things as your long term requirements change.
Subversion: where have you been all my life!?
I installed Subversion on my server to manage a few of my own projects. This was mainly just to try it but I hadn't had much chance to play with it simply because I had been busy with work. When Chris and I started the book (Swing Hacks, coming soon!) we decided to use revision control rather emailing files back and forth. Since we each work on our own hacks there wasn't too much need for managing multiple author revisions. In fact, the code doesn't change that much at all. You write it, check it in, and then maybe do two revisions later on during editing. Since the text is all done with Word you wouldn't be doing merging anyway. Really we just needed it for the file sharing abilities. It's worked quite well. You create directories, check in hacks, and do updates. Very smooth.
The best part, though, has come during the editing phase. As we have started assembling chapters we have needed to move everything around and start changing filenames, directories, and order. screenshot.png isn't very descriptive when you have 100 hacks that need screenshots. This is where Subversion has really come into its own. A simple svn rename takes care of everything. We can move any directory or file around and nothing breaks. rename simply works!. When we update the tree all of the changes come accross fine. If I have a directory with a few extra files that aren't revision controlled Subversion will warn me before I rename that directory. I can force it to do the rename and it still does the right thing. This is really the way it should always have been done.
It's coming
Subversion is still immature. The client and server themselves seem quite stable (and fast) but the tool support just isn't there yet. We don't have svn access at java.net yet. I haven't found a webscript to show the source online the way view-cvs does. I don't have a subversion plugin for my favorite editor either. It's coming though. In the long run I don't see a reason to use anything else. Fast, solid and free. Sounds good to me.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Actually, CVS works quite well if you aren't connected to the repository. Many client applications will hit the server whenever you perform an action, but this is not necessary. I have done quite a bit of development on a commuter train. When I get back on the network, I do an update to merge with any changes that might have happened, then add new files and commit my changes. It all works very well.
As for renaming, I would expect SVN to work better than CVS. CVS doesn't really version directory/file structure. It does all visioning at the file level, so renaming a file causes a delete and a create - there is no relationship between the old and new files.
Posted by: jeffdrost on March 24, 2005 at 10:07 AM
-
Josh, working on the book let me to use SubVersion for the first time, although I wanted to try it for a long time now. And I must admit I totally agree with you: it rocks :)
Posted by: gfx on March 24, 2005 at 10:42 AM
-
Just about every project I've worked on has made heavy use of branches. How else can you do release management?
If you're interested in a mechanism whereby you can work offline (including checking in and out), you might check out GNU Arch. They take the opposite view to CVS/Subversion by storing the changesets instead of the elements (the edges of the version tree instead of the nodes). I haven't used it myself, but it sounds interesting.
Posted by: richunger on March 24, 2005 at 11:14 AM
-
Hey Josh--My favorite CVS client is SmartCVS, which now has a version for SVN as well. The CVS client is great, so I'm hoping the SVN one will live up to the same standards. There is a community version for personal use: SmartCVS website. Patrick
Posted by: pdoubleya on March 28, 2005 at 06:51 AM
-
Josh,
Most of the time a version control system is thrust upon you without much choice. When you have a choice, darcs and Superversion are both worth a look. In the long run version control will become more tightly integrated into the filesystem.
- Curt
I think Version Control System (VCS) is a slightly better term, because RCS was once a popular VCS, although it has been largely supplanted by CVS.
Posted by: coxcu on March 28, 2005 at 07:33 AM
-
VCS is less ambiguous. Thanks
I agree that most developers don't have a choice. I started with CVS thanks to my early days of linux hacking. I've only used the others when they were forced upon me.
For the developer I don't think the underlying VCS matters as much as the tools that the developer has to work with. What's the interface like? The actually branching / merging abilities tend to be more of an issue for either the senior engineers or project managers since they have to deal with the larger code base issues. The average developer just checks their own module out and in again. That's why I like CVS and now Subversion: because they are so open that the developer can use whichever interface they like. All that said, the atomic commits and renaming abilities in Subversion are a really nice feature to have. What's impressed me most as a developer (rather than as a project manager or architect) is simply the speed and offline support. It just feels like it's the right way to do it.
Posted by: joshy on March 28, 2005 at 07:43 AM
-
I too was a subscriber to the branches are not needed, branches are a pain view of the world while I was using CVS. Now that I've been using perforce for a while I've changed my mind. Branches are actually very useful things, even sometimes short lived per developer branches, and certainly using branches for different software releases is vital. The problem is generally with the difficultly of merging changes from different branches together and perforce does a really good job at this.
Posted by: alexmoffat on March 28, 2005 at 08:28 AM
-
If you want to be able to use revision control when you are not connected, maybe you should try one of the distributed version control systems. There are quite a lot nowdays, and they are evolving quickly. My favorite one is Monotone (http://www.venge.net/monotone). There is also Darcs, which is apparently very easy to use, and it is becoming very popular.
The idea behind those systems is that you always keep a local copy of the repository (disk space is not a problem anymore is it?), and synchronize repositories when you want to merge your work. Since you keep a local repository, you can check-in and check-out at any time, without being connected to the network.
Posted by: sergiogarcia on March 29, 2005 at 12:18 AM
-
ViewCVS works for Subversion too; provided you use the latest(CVS) version.
Posted by: ken_devon on March 29, 2005 at 02:46 AM
|