Pragmatic Version Control Using Subversion
Chapters on repository layouts, integrating third party code (into your source tree and products) and conflict resolution all help raise this book from just being a single application tutorial into a best practices guide that you'll come back to long after you've gained confidence with Subversion itself.
Pragmatic Version Control Using Subversion is very similar to Pragmatic Version Control Using CVS, but this is in no way a criticism! The previous book was the best introduction to CVS that I've read, and this related volume manages to retain the winning formula while adding useful sections, such as CVS hints, to help people migrating across.
While the book has a broad appeal, the ideal audience are those developers who know they should be doing version control but have heard it's too complex, have been burnt by previous mistakes, or just don't know where to start. Seasoned developers will also find this book useful, but in different ways. For instance, using it as an easy to scan and follow reference, handing it down to less experienced colleagues, or even just for quickly bringing themselves up to speed when moving from CVS to Subversion.
Considering the book's slim size (or quick download, if you purchase the PDF version) it packs in surprisingly wide coverage of the important topics. The first two chapters provide an overview and sell the benefits of using a version control system. They cover what should and shouldn't be under version control, and clearly explain the terminology required to understand both the technology in general and the book's later chapters.
Chapters 3, 4, and 5 get you working from your own Subversion repository and introduce the essential commands. They show how to create, add and import your projects in a clear, easy-to-understand way. Once you have some files to work with, they take you through a well-paced tour of the simple operations; checking out, committing and accessing the files in different ways.
Following these, Chapter 6, "Common Subversion Commands," shows some of the more complex but essential tasks you'll want to perform in Subversion; setting properties, looking at changes and their associated history and how to handle merge conflicts. These are all presented in short sections that provide enough information to be useful on a day-to- day basis while not leaving beginners bogged down in the minutiae.
Jumping ahead slightly, we leave the part of the book that everybody using Subversion should read and move onto the more powerful, and complex, functionality such as "Using Tags and Branches" (Chapter 8) and the more abstract topics of "Organising Your Repository" (Chapter 7) and dealing with "Third Party Code" (Chapter 10).
Chapter 8 stands alone in the second half of the book due to its coverage of a very technical subject; chapters 7, 9 and 10 are more abstract. Tagging and branching are one of the more notorious areas of version control, but this book -- much like the CVS book before it -- manages to explain not only when and how to use both tags and branches, but also provides enough guidance to allow the reader to 'smell' when something's wrong and adding them would make it worse.
Chapters 7, 9 and 10 logically combine to cover the issues surrounding setting up your own project, including the project's structure, the integration of third party code, external projects, and binary libraries such as Nunit or Java mock libraries. Considering the amount of maintenance coding (as opposed to new projects) that happens in the world, these chapters might not be immediately useful to a fair chunk of the readership. I don't think they should be removed, though -- better to leave them in and show best practices and experience-driven common sense than remove them and let people make the same mistakes over and over again.
It's worth noting that the appendices are a lot more useful than the filler material typically found lurking at the back of a book -- they cover a couple of topics that don't fit elsewhere and help round out both the book's coverage and appeal.
Appendix A is more relevant to system administrators than developers. It shows how to install Subversion on the server. It then gives a brief introduction to configuring, serving (using either the native svnserve, svn over SSH or via Apache) and adding basic security to your repositories. It finishes off with a short, but useful, digression into backing up your hard work.
This appendix provides a valuable, quick guide to getting a Subversion install in place. It's a good starting point for anyone who needs to actually run and maintain a Subversion server.
The remaining appendices vary in usefulness. Appendix B is a concise introduction to migrating a CVS repository to Subversion; this is something you either need desperately or won't care about. Most of Appendix C shows how to perform common tasks using the TortoiseSVN extension for Windows Explorer; this won't appeal to the Unix/Linux crowd but might help sway Windows developers away from the hell that is Visual Source Safe.
In short, whether you're new to version control in general or just Subversion itself, this book is highly recommended. Clear, concise and crammed full of useful, important and dare I say, pragmatic, advice and information. An excellent book in its own right and a worthy addition to the Starter Kit Series.
Dean Wilson is a System Administrator at Outcome Technologies. His personal site is unixdaemon.net. You can purchase Pragmatic Version Control Using Subversion from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page
For those looking for Subversion documentation, there's also an excellent Subversion book, with electronic copy available for free, at http://svnbook.red-bean.com/
My only problem with Microsoft is the severity of bugs in their software.
The Subversion Book seems to have most of what you need to know and its free as in speech and beer.
from the review it does seem to have a couple of chapters about general project organization that aren't in TSB. Otherwise it the list of topics seems to be right out of the oreilly book.
Executive summary:
By the way, the GCC team is starting to make experiments with svn, and it looks like they might switch in 2 or 3 months.
We are switching from PVCS to subversion. Besides being pretty crappy and expensive, PVCS uses the lock/modify/checkin paradigm. Every time when I convert a PVCS user to Subversion they are scared because of the edit/conflict/merge idea. "OHMYGOD I have to lock my files or anything can happen". (Because I am not articulate) I have a hard time conveying the benefit of the CVS/subversion way.
My rationale is that if two people need to modify a file the conflicts exist independent of the version control mechanism, its just that locking serializes modifications and and merging has you modifying in parallel and then fixing it all at once, which is more efficient than making someone wait. Not to mention the idiots who lock everything and then go on vacation.
I usually just say 'try it and you will see that subversion is way easier to use and the rare conflicts are easy to merge'.
Any recommendations?
From the document:
Subversion's Features
When discussing the features that Subversion brings to the version
control table, it is often helpful to speak of them in terms of how they
improve upon CVS's design. If you're not familiar with CVS, you may not
understand all of these features. And if you're not familiar with
version control at all, your eyes may glaze over unless you first read
Chapter 2, Basic Concepts, in which we provide a gentle introduction to
version control in general.
Subversion provides:
Directory versioning
~ CVS only tracks the history of individual files, but Subversion
implements a virtual versioned filesystem that tracks changes to whole
directory trees over time. Files and directories are versioned.
True version history
~ Since CVS is limited to file versioning, operations such as copies
and renameswhich might happen to files, but which are really changes to
the contents of some containing directoryaren't supported in CVS.
Additionally, in CVS you cannot replace a versioned file with some new
thing of the same name without the new item inheriting the history of
the oldperhaps completely unrelated file. With Subversion, you can
add, delete, copy, and rename both files and directories. And every
newly added file begins with a fresh, clean history all its own.
Atomic commits
~ A collection of modifications either goes into the repository
completely, or not at all. This allows developers to construct and
commit changes as logical chunks, and prevents problems that can occur
when only a portion of a set of changes is successfully sent to the
repository.
Versioned metadata
~ Each file and directory has a set of propertieskeys and their
values associated with it. You can create and store any arbitrary
key/value pairs you wish. Properties are versioned over time, just like
file contents.
Choice of network layers
~ Subversion has an abstracted notion of repository access, making it
easy for people to implement new network mechanisms. Subversion can plug
into the Apache HTTP Server as an extension module. This gives
Subversion a big advantage in stability and interoperability, and
instant access to existing features provided by that
serverauthentication, authorization, wire compression, and so on. A
more lightweight, standalone Subversion server process is also
available. This server speaks a custom protocol which can be easily
tunneled over SSH.
Consistent data handling
~ Subversion expresses file differences using a binary differencing
algorithm, which works identically on both text (human-readable) and
binary (human-unreadable) files. Both types of files are stored equally
compressed in the repository, and differences are transmitted in both
directions across the network.
Efficient branching and tagging
~ The cost of branching and tagging need not be proportional to the
project size. Subversion creates branches and tags by simply copying the
project, using a mechanism similar to a hard-link. Thus these operations
take only a very small, constant amount of time.
Hackability
~ Subversion has no historical baggage; it is implemented as a
collection of shared C libraries with well-defined APIs. This makes
Subversion extremely maintainable and usable by other applications and
languages.
The truth is an offense, but not a sin.------R. N. Marley
Well, assuming that you're declaring computer science superior over the pragmatic approach, I've started wondering about that recently.
Let me start off by saying that I'm firmly in the scientific camp, intending to start a PhD in CS this (northern) summer. It seems that an awful lot of popular things in IT are despised by computer scientists. Linux, as a monolithic kernel, is a famous example, as is C++, and I recently saw something about Perl being evil as well.
Now, these scientists have good reasons to call these things ugly, but people still use them. That means that either people are stupid, or the computer scientists are missing something. I think that it's mostly the latter.
In my software engineering course I was taught that the first and foremost thing you do in a project is gather requirements. It seems to me that computer scientists need to get out and ask people who work in IT what they actually expect from their kernels, languages, and development systems. Then they can try and create theories of how it all works or should work to fulfill those wishes, and use those theories to improve those real-world systems.
The alternative, sitting in your ivory tower inventing things that you think are pretty and everyone else thinks are useless, doesn't seem to be working too well.
I perfer to use intimidation:
"Touch my code and I will beat you with silly with a rolled copy of the original spec docs."
Seems to work for me.
-- TMKPerforce is undeniably better than SVN.
:-)
It has the ability to collect changes for grouped check-in against an issue. And it has the excellent, albeit somewhat clunky GUI. I loved using Perforce and I recommended it.
However, after trying SVN, I would have to say that Perforce is not $750 per seat better than SVN. SVN has most of the functionality I looked originally to Perforce to get (mostly the atomic commits) and it is slowly but surely maturing.
The GUIs are coming along and even the ANT and Eclipse plugins. And eventually SVN will have a more fully implemented WebDAV interface (Perforce does not).
I feel bad that now that SVN is getting up to speed that Perforce is going to lose out. However, this is something that is happenning across the entire Developer tools market. Everything in the developer tools market space will eventually go Open Source. (most already are)
Perforce had their run and now they will need to branch out or make a new version of themselves by adding on significant new features.
Or otherwise they will disappear from the market. If so, they will be missed.