Slashdot Log In
Pragmatic Version Control Using CVS
from the means-ends-analysis dept.
| Pragmatic Version Control Using CVS | |
| author | David Thomas and Andy Hunt |
| pages | 159 |
| publisher | Pragmatic Bookshelf |
| rating | 10 |
| reviewer | Jared Richardson |
| ISBN | 0974514004 |
| summary | A hands on CVS introduction and tutorial, |
What's the approach?
The philosophy of this series is summed up on the Starter Kit website:Software development is difficult enough; if you try to build on a shaky foundation it can make development almost impossible (which might account for the fact that about 50% of all software projects fail). You need a firm foundation: The Pragmatic Starter Kit is a set of basic, common-sense practices applicable in all software development environments. The techniques given in these three books are not expensive to implement and are not hard to learn, but can make the difference between being a success and being a statistic.
The first book in the series covers the what, why and how of software versioning, using CVS for the examples. It walks you through installing CVS clients, setting up your server, and using basic commands, then teaches advanced concepts. It is the new CVS handbook that can be used by both beginners and veterans.
Target Audience
This book, like The Pragmatic Programmer, should have very broad appeal. It should be required reading for any junior developers or CVS administrators, and it should be a bookshelf reference book for mid-level to senior developers. It is slanted heavily towards CVS, but given that CVS is free and widely used, that shouldn't prevent anyone from using the book to learn the concepts, even if their company uses another versioning system for production work.
What's to like?
As is usual for Thomas and Hunt's books, this one is a very easy read. The concepts are clearly laid out, with plenty of working examples throughout. There is a good coverage of the fundamentals as well as very advanced topics. Unlike most CVS books or tutorials, this text is clear and straightforward. It's easy to understand and follow. It's got the best coverage of CVS branching and merging that I've ever read!
What's to hate?
Honestly, there is not a lot here that I don't like. The introductory chapters are little too basic, but since the book is (partly) aimed at beginners, that's okay.
Why bother reading this book?
I've been using CVS for over six years now (including being the CVS admin at two companies) and this book covered a few very useful advanced topics that I had never even heard of. An example of this is the use of vendor tags (Chapter 10). Using this feature, you can have a local copy of your favorite open source project in your company's CVS server and make changes to it. You can then merge your local project with the new releases of the public project, and CVS will handle merging your changes with the public baseline. This feature is incredibly useful, but I didn't even know it existed until I read this book.This book is a great introduction if you've never used a versioning system. By the time you've finished the book, you'll have installed CVS (client and server), created projects, created new files, merged changes, etc. If you already use versioning software, it can remind you about the features you've forgotten about (or never knew existed). This book is a great introduction and a great refresher too.
Where to buy?
Not so long ago in another Slashdot article, Andy and Dave suggested that in order to compete in the new global economy, we should all diversify our skill sets. To that end, this book is published under their new publishing company, The Pragmatic Bookshelf. You can buy copies from the Pragmatic Programmer's web site in both dead tree ($29.95) and PDF ($20.00) formats.
Summary
As we have come to expect from Andy and Dave, this is another great book. The technical content is rich and clear but it won't put you to sleep. It has appeal to both newbies and veteran developers. I give it '10 out of 10 slashes.'
Richardson met Hunt while he and Thomas were finishing up The Pragmatic Programmer and has reviewed each book that they have written since -- he makes no bones about liking their work.
more reviews (Score:4, Informative)
Which book was a watershed event? (Score:5, Insightful)
(http://www.cravenfamily.com/)
On another note, does anyone else want to scream every time someone says 'best practice'?
GNU Arch is better than CVS (Score:2, Informative)
Check out Arch. [gnu.org]
Wait for IDE support, please... (Score:4, Insightful)
I can't really dump CVS until there is support for the major IDEs (Including EMACS!).
Interestingly, Subversion support for Eclipse and Netbeans is available.
-- ac at work
Re:GNU Arch is better than CVS (Score:5, Insightful)
WRT your "unfinished" impression: The code itself is very clean, well-polished, readable, and robust. My only qualm is with the error-handling; there are lots and lots of sanity checks throughout, but the error messages aren't always as useful as they could be (asking for a revision that doesn't exist might give something like "File not found", or even more opaque, rather than "that revision does not exist"). Bugs that cause such things to happen without involvement of user error are extremely uncommon.
With regard to speed, I'm not sure if you'recomparing SVN to CVS or Arch; if the latter, be sure you're comparing against tla 1.1 or later with a revision library enabled. (Even more optimizations are on their way -- Chris Mason of SuSe has proposed a patch which brings the time to replay 100 changesets down to about 4 seconds in optimal conditions; some cleaned-up variant may well make it into tla 1.2 or 1.3).
what i hate about cvs (Score:5, Insightful)
(http://frymaster.ca/ | Last Journal: Monday September 15 2003, @12:58AM)
cvs checkout -r mytag repository
cvs log -rmytag -d 'yyy-mm-dd'
two -r switches but... the first one has a space before the tag, the second one doesn't. when you look at the cederquist doco online the html really doesn't make this clear.
if this book addresses this one quirk it's worth a hundred bucks.
But does it have a GUI (Score:3, Funny)
CVS good, ClearCase bad (Score:5, Interesting)
(http://www.cravenfamily.com/)
A full build of a sample project with CVS takes me 30 seconds. CC takes 7 min, 30 sec.
CVS doesn't need multi-site repositories, clearcase does if you have a lot of remote development.
CVS doesn't integrate with the kernel, so if CVS crashes it doesn't take your whole machine.
CVS has better add-on GUI tools for branching and comparison.
It is easy to create and apply patch files with CVS, something not easy to do with CC.
With CC, when you check out a file, you can't actually write to it. You have to loop and keep checking for the file to be 'writable' after check out. Even then, sometimes when CC marks the file as writable, it really isn't.
A batch update in CVS is easy, with CC you have to check out individual files. I have a script for this. A batch update takes about 20 minutes compaired to 45 seconds in CVS.
CVS is free.
CVS doesn't require as much training or support time as ClearCase.
ClearCase does have excellent command-line tools. It also has a lot more features. But you can probably live without them.
Re:CVS good, ClearCase bad (Score:5, Insightful)
Re versioning directory structures: If I rename the directory "a" to be called "b", and do a commit, I want people who do an update to suddenly have "a" renamed to "b" -- with all their local changes still intact. Subversion does it, Arch does it, CVS won't.
With atomic commits: I change 3 files. I want do a single commit that makes these 3 files part of one atomic change. If someone does an update and gets one of these, I want them to get all of them. (Say they're a change to a method description in a header, a change to the C file implementing that method, and a change to another file calling it -- if someone does an update and only gets one of the 3 they always have a broken tree; they should have all or none). CVS won't do that; Subversion will, Arch will.
See my other post [slashdot.org] for a bit more on why modern revision control systems are more useful.
Re:CVS good, ClearCase bad (Score:5, Interesting)
Actually, in practice, I've found Arch to be not only more featureful than Subversion, but much more robust as well.
Tom Lord (Arch's author) has written a few screeds with his interpretation of where the Subversion design and development process went wrong (to take so many man-hours to develop a product which, in his view, has severe design flaws); his arguments there are likely to be much better than any I could make here.
Re:CVS good, ClearCase bad (Score:4, Informative)
Re:CVS good, ClearCase bad (Score:4, Informative)
I have supported development using CVS, SCCS, ClearCase, Kintana and BitKeeper. Each system has its advantages and disadvantages. For ClearCase, the biggest disadvantage is you have to read the manual.
"A full build of a sample project with CVS takes me 30 seconds. CC takes 7 min, 30 sec."
If I tune my mustand to run like crap, it will. Don't blame a tool if you haven't RTFM.
"CVS doesn't need multi-site repositories, clearcase does if you have a lot of remote development."
Bold assertion, care to provide even the slightest amount of example, or dare I say proof? How about a plan for using CVS across 500 developers in 8 sites, on 5 time zones. Ohh, and we are a worldwide company, so all developers need access to all code.
"CVS doesn't integrate with the kernel, so if CVS crashes it doesn't take your whole machine"
True. Thanks for providing context with a claim.
"CVS has better add-on GUI tools for branching and comparison."
Probably another RTFM. ClearCase has many powerful tools, but you have to learn how to use them. This in itself is a downfall as the quality of available software engineers continues to fall.
"It is easy to create and apply patch files with CVS, something not easy to do with CC."
Why?
"With CC, when you check out a file, you can't actually write to it. You have to loop and keep checking for the file to be 'writable' after check out. Even then, sometimes when CC marks the file as writable, it really isn't."
Your wrong, but I don't have time to cut an paste the manual over. You really should trying reading it sometime.
"A batch update in CVS is easy, with CC you have to check out individual files. I have a script for this. A batch update takes about 20 minutes compaired to 45 seconds in CVS."
I think your kinda sorta talking about a Snapshot view. Read the manual, pick up the nomenclature. It takes me 3 seconds to pick up all the changes in need in my dynamic....
"CVS is free."
True.
"CVS doesn't require as much training or support time as ClearCase."
I call bullshit. Its clear(har har) that you have never supported Software configuration management. CVS doesnt require training if all of you engineers already understand CVS. I expect the same to go for ClearCase...
"ClearCase does have excellent command-line tools. It also has a lot more features. But you can probably live without them. "
It has flexibility, which last time I looked increases strength. Learn what you need and ignore the rest.
Re:CVS good, ClearCase bad (Score:4, Funny)
(http://www.cravenfamily.com/)
I forgot to mention where ClearCase is much better than CVS though, and that is Sales People. No CVS people will take you golfing.
CVS cons? (Score:3, Interesting)
(http://www.jasonhallphoto.com/ | Last Journal: Thursday October 02 2003, @08:39AM)
My current way of version control is the old way of just zipping up each release!
Pros for single user version control (Score:4, Insightful)
Starting a project in CVS is simple.
Create a directory. Maybe add a descriptive text file or two. Run cvs import from within the directory. You'll then need to do a checkout, and you're ready to begin adding makefiles, source code, autoconf delights/madness. For what it's worth, I always rename the original directory before the checkout in case CVS has a glitch. Older CVS balked at overwriting the files; maybe that's still the case.
The last reason that I use source control even for projects that I am the sole developer is that I have on occassion, deleted critical files by mistake, and had to reimplement entire classes/modules under duress. It's a rare event, but with source control, I'm less stressed over the possibility of screwing up.
-Hope
Example CVS project starting point (Score:4, Interesting)
or
Generally, you may wish to start with a simple project and check it in before beginning your work in earnest. The fewer files the better, and if you've already run configure and have hundreds of non-source build files in the directory already, it can be time consuming to remove them, despite helpful make targets. I try to start with as few files as possible, and add all my source files explicitly.
From here, one merely needs to checkout the project, add, and commit source files.
Obviously, a good bit of the first part could be scripted... I don't bother since I find project setup somewhat zen anyway. I enjoy the ceremony of it, and it's not a daily task anyway.
-Hope
Re:CVS cons? (Score:4, Interesting)
(http://www.leibman.net/)
Programming (at any level, small OR large) without source control is like playing in the high trapeze without a net, yeah, you can do it, and if you're really good you'll get away with it for a while, but when you miss you'll be sorry.
Source control gives you a backup of your work, a storyline of what you've changed add to that the advantages of such a system when working with more people and I really can't imagine not having a source control system.
As a consultant, it is the first question I asked before taking on a project: what do you use for source control. I run away if they don't have one and are not willing to let me install one.
Slow Starter (Score:1)
As someone whose been desparately trying to get a grasp on some advanced CVS concepts lately, especially vendor tags and tracking of third party sources, I'm a little disappointed at the slow start the book gets off to; it feels just a bit belabored reading another introdution to the basics, but I'm glad to hear there's good stuff further on. Guess I'll get back to it.
svn (Score:1, Informative)
(http://www.rapidpacket.com/ | Last Journal: Friday May 02 2003, @07:12PM)
By the way, backports.org has a wonderful woody backport of subversion.
slashes (Score:4, Funny)
Shoehorning CVS to work with good dev practices... (Score:5, Informative)
Aegis, GNU Arch (my personal favorite), Subversion, BitKeeper... all of these work around CVS's worst failings. What's unfortunate is how few people have had their expectations of what a revision control system should do set far too low by CVS.
A few examples of features one should expect of a modern revision control system:
Re:Shoehorning CVS to work with good dev practices (Score:4, Informative)
(http://jasonrumney.net/)
Look up commitinfo in the CVS manual. It does both of these things.
How's about (Score:1)
(http://www.diamondcellar.com/)
Online CVS reference (Score:5, Informative)
(http://joskunst.net/)
Open Source Development with CVS [red-bean.com] by Karl Fogel is a great online CVS manual and reference. I use it all the time.
JP
Silly CVS Uses (Score:1)
(http://www.duckfoo.net/)
vendor branches???? (Score:1, Interesting)
Does it explain why files stay on the vendor branch until you change them? (Which means if you change a couple files, they are on your main line, but the rest stay on the vendor branch).
That really bugs me (i.e., shouldn't the vendor branch be tagged with only vendor's version numbers, and your main line be only tagged with YOUR tags, instead of mixed on both branches?)
I found out that "cvs admin -b" will move the vendor code to the main line, so I always run that command after importing vendor branches. But it really doesn't make sense.
It's much more logical to do vendor branching in Subversion (even though you are technically doing them "by hand", like all tagging and branching in svn).
Anybody know what I'm talking about, or is this like "super-advanced CVS for anal pricks"? Maybe.
Anyway I hope this book is good. I found the O'Reilly book to be awful. I love their Ruby book.
no one has mentioned TortoiseCVS (Score:2)
No Amazon? (Score:1)
(http://www.no-spoon.de/)
Some facts about Subversion (and CVS). (Score:1)
(http://www.red-bean.com/kfogel/)
But on to the real reason for my post:
Some of the posts here make simply wrong statements about Subversion. Below are corrections.
1. Subversion does not require a Unix user account per vc user. Furthermore, this is true not just with the WebDAV (http://) access method, but also with the svnserve (svn://) method. Some posts said otherwise; not sure why.
2. Subversion does *not* require Apache, nor does it require you to use the WebDAV protocol for repository access. Apache/WebDAV is one of two entirely independent network access methods. The other is a custom protocol (think of it like CVS pserver) using a custom server (svnserve) and its own URL space, "svn://".
3. Subversion is not in Alpha anymore, it is in Beta. This was a recent transition, so it's understandable that people wouldn't have known about it.
4. Someone said you can't make client-side graphical reports about revisions and differences, because the client doesn't have access to the right information. I think this person must have read and misunderstood a highly technical mailing list thread. The client does have access to the necessary information already (see 'svn log -v' for starters).
People with further questions about Subversion should please come to users@subversion.tigris.org, or irc.freenode.net, channel #svn. Hope to see you there!
By the way, I have not used Arch in a long time, so can't comment on the differences between it and Subversion.
Re:Perforce (Score:5, Informative)
Yep. I started using it about a month ago. Within three days I was so enamoured of it that I switched all my projects to it. Anyone who has used CVS should be able to switch almost without retraining. And the best thing of all is that the documentation (a downloadable book) is thorough, well-written, up-to-date, and full of useful examples. This project should win some sort of prize; it deserves it.
Re:Perforce (Score:1)
Re:Perforce (Score:2)
(http://www.ghostwheel.com/)
I hate the price, and their weird-ass pricing scheme. For a quick case of sticker-shock, just go to http://www.perforce.com/perforce/price.html
-Chris
Re:Perforce (Score:2, Informative)
(http://www.intercom.net/user/logan1/bkk.htm)
I. Free or nearly free--includes: CVS & SubVersion.
II. Under $1000 per seat--includes: AccuRev & Continuus CM.
III. More $$$ than you can possibly imagine--includes: ClearCase & StarTeam.
To cut it short, we eventually went with AccuRev [accurev.com], due mostly to environmental and budgeting restrictions. It's an unobtrusive, often maddingly slow, Java-based product, which happily fits most of our needs.
There's a huge field of versioning products out there, most of which can only be found on poorly documented company websites, many without demo's. And each of them promises to be the last word in SCM, but with little to no comparison between vendors. (Oh sure, product FooSCM includes LifeCycle Management, but the definition & amount of "Lifecycle" varies greatly from one product to the next!)
Caveat emptor!
Re:Subversion - CVS is dead and burried within 200 (Score:1)
(http://www.red-bean.com/sussman)
If you want a serious answer: we have several db tables. The values in the tables are lisp-like "s-expressions" that hold real data and keys to other tables. It's a way of getting "columns" when you don't have a real SQL backend. And by the way, it works extremely well.
(We do have future plans, however, to give the repository a real SQL backend someday.)