November 14, 2011

Version Control by Example

Version Control by Example Book CoverI recently finished reading Eric Sink's Version Control By Example. It is a concise and clear book about modern version control systems, easy to read and understand.

The book's goal is to introduce you to version control. It doesn't dig deeply into details, but rather covers concepts, techniques, and best practices. It uses the clever approach of taking a simple example

The company has assigned two developers to work on this new project, Harry, located in Birmingham, England, and Sally, located in Birmingham, Alabama.

and then working through the details using four modern version control systems:

  • Subversion
  • Git
  • Mercurial
  • Veracity (the system written by the author)

Sink devotes an entire chapter to the details of the worked-out example for each system, showing the commands that each developer issues and the responses that the system returns. Even better, he structures the example so the developers encounter many of the common situations that arise during team development of software:

  • checkout, add, status, commit
  • log, diff
  • update, commit
  • move, rename
  • delete, lock, revert
  • branch
  • merge, resolve conflicts
  • etc.

Although the example is fairly simple, it is sufficiently complex to show the power of a version control system, and to demonstrate how the developers are able to use it successfully to work together in a productive fashion. The author keeps the example flowing along nicely with a lighthearted writing style and lots of humor:

But Harry did commit his changes! Why aren't they here? Ah, he forgot to push. Sally screams at Harry loudly enough to be heard six time zones away.

In addition to the chapters showing each system by example, Sink includes several chapters covering high-level concepts, common vocabulary and terminology variations among version control systems, various workflows that are typically used by software development processes, and ends with a nice list of best practices for getting value out of your version control system.

 

My only real complaint about the book is that Sink doesn't cover Perforce. Perhaps in your next edition, Mr. Sink?

I found it quite useful to see the comparison of the various version control implementations. To continue the discussion, my colleague Zig Zichterman and I updated the chart to show two additional views:

  1. How the various tasks are performed using Perforce in its centralized configuration
  2. How the various tasks are performed using our new Perforce Sandbox feature (now in Beta testing!)

Our revised chart can be seen here. If you're interested in learning more about the upcoming Sandbox functionality, Zig has written more about it here. For those readers who'd like to see a deeper analysis of how these issues are managed in Perforce, have a look at Laura Wingerd's Practical Perforce, which covers these same topics from the Perforce perspective.

If you're involved with version control (and you probably are, since you're reading this blog!), I think you'll find Sink's book informative and useful. The author has made the book available for free download from his website, in both simple PDF and a variety of e-publishing formats, or you can also buy the printed edition. I bought the printed edition, myself, and can report that it is nicely bound using a high-quality paper, in case that influences your choice.