Pragmatic Version Control with Subversion

Pragmatic Version Control Using SubversionLast week I received my copy of Pragmatic Version Control Using Subversion, which I had preordered from Amazon.com.

As I’ve written before, I’ve been a big fan of the Pragmatic Programmer series of books for a while and when Pragmatic Version Control Using CVS came out a while back I was hoping that it was just a matter of time before a version of the book focused on Subversion would be released.

This is a good practical reference book for people just starting out with version control and Subversion. Chapter 2 is where the fun really starts, with an explanation of version control and it’s basic concepts, from the repository, through working copies, tags, branching and merging. There is also a very good explanation of locking models present in different tools and when and why you would use them. The use of scenarios to illustrate the point makes the concepts easy to understand, even for a beginner.

Chapter 3 is the ‘Getting Started’ chapter. This chapter covers installation and all the basics needed to get started including creating your first project, committing to the repository, resolving conflict — at a high level. The installation section basically covers checking your machine to see if you already have the tool installed. If it doesn’t there is a whole Appendix on installation, securing the server and administration that you are referred to.

Chapters 4-10 gets into the nitty gritty of using Subversion and covers everything from the basic commands to repository organization, vendor branches, tagging and branching. These chapters are very good for the beginner.

In the beginning of Chapter 4, the author articulates the philosophy of the book. An excerpt follows:

We think version control is one of the three essential technical practices; every team needs to be proficient in all three (the others are Pragmatic Unit Testing and Pragmatic Project Automation). Every team should be using version control — all the time, and for everything they produce. So we have to make it simple, obvious, and lightweight (because if we don’t people will eventually stop doing it).

The book I have in front of me definitely holds to the philosophy. It is a very well written book that, as all books in the Pragmatic series do, gives extremely practical advice on using version control, and making it simple enough that it looks like it is something you can sustain.

I would recommend this book for those who are just starting out and want to get something up and running quickly. One of the most important things in implementing version control, from my experience, is not learning the tool but absorbing the concepts. If you do not understand the basic concepts, the process can be quite difficult. Pragmatic Version Control Using Subversion does a really good job of explaining the base concepts in a simple to understand manner while also giving you the step by step of how to perform tasks that you will use in every day life.

If you are looking for really advanced topics such as development with the Subversion libraries, this is not the book to pick up. This is strictly for those who want to use version control for their projects and want to get it going quickly.

For the more advanced, I would highly recommend Version Control with Subversion, written by the Subversion development team, or Practical Subversion by Garrett Rooney (also a Subversion contributor).

Base-Art / Bringing RSS to SVN

For a while I have wanted to be able to build RSS feeds off of the commit activity in a Subversion repository in order to publish the latest commits to an internal intranet site. I found a blog article called Base-Art / Bringing RSS to SVN this morning that makes this possible.

This is yet another note to myself to check it out and see if it fits what was in my head. It may also be an indirect note to Keith to check it out for me. 😉

From what the site says, this allows you to build the RSS feed in a post commit hook, in addition to building a separate HTML file for browsing independently from RSS, and does it all incrementally.

Online Code Reviews with CodeStriker

One of the most difficult processes to implement in a development environment is the code review process. That’s not to say that code reviews aren’t done, but they are often done informally and there is no documentation that a review existed. In order to get this documentation often a paper based solution has to be devised, causing more manual work and less time to cut code.

Codestriker is an application originally written by David Sitsky that allows web based code reviews. The tool can talk to both Subversion and CVS repositories and will produce a diff based display in which you can enter comments on a line by line basis and track their progress through the review process.

There are two ways to get a diff file into the system. The first allows you to talk directly to a Subversion or CVS server in order to grab a range of revisions from the repository. For repositories that CodeStriker cannot talk to natively, you can produce a diff file to upload to the server. This functionality allows the tool to work with source control systems such as RCS, Clearcase, or Perforce.

A few of my collegues and I have been using Codestriker to do code reviews amongst ourselves for quite a few months now and the tool makes the process much more manageable (and visible!). Having the tool online allows an author to receive immediate feedback via email when a comment is added to a review topic. This allows you to implement (or reject) review input as it comes in rather than getting a ton of work at one time that you have to finish before release time.

The Codestriker tool is written in PERL and runs as a CGI script over a MySQL database. The installation process is pretty straightforward and a full user manual exists on their web site.

Some of the features of the application that I really like consist of the following:

  • All review comments are in a centralized place that is accessible via a browser
  • Reviews (or topics) can be generated from a live CVS or Subversion repository
  • If the review was generated from a live repository, you have “parallel view”, which shows you the full file differences so that you can see all of the changes in context
  • Comments are added per line
  • When a comment is added to a particular line, the person who initiated the review is notified via email
  • and finally, all review comments are in a centralized place that is accessible via a browser!

The best way to get an idea of what CodeStriker can do for you is to take a look at some screen shots. If you like what you see, download and install it for a test drive.

100% Pure Java Subversion Client Libraries

As a note to myself, I have to look at JavaSVN when I get a chance. Its a pure Java implementation of a Subversion client.

Some things I have to research:

  • What would it take to integrate this into CruiseControl to eliminate the need for the Subversion client being installed on the box?
  • What would it take to integrate this into Apache Ant for the reason listed above.
  • Finally, has anyone actually already done the above two things?

I’ll post the answers back here when I find out.

Trac: Integrated SCM and Project Management

This post is more a reminder to myself than anything else. As I was browsing the wordpress plugin repository I saw they are using version 0.8 of a product called Trac that integrates with Subversion and provides basic project management and defect tracking.

The site says the software does the following:

  • An integrated system for managing software projects
  • An enhanced wiki
  • A flexible web-based issue tracker
  • An interface to the Subversion revision control system

This looks really interesting and I need to remember to check it out. I tried to download it this morning, but it seems the download area of their site is down.

Update: Edgewall.com is not down. For some reason, FireFox was giving me zero reply error. When I went to a Windows machine with IE, I was able to download the software.

Pragmatic Version Control with Subversion Book Released

Pragmatic Version Control Using SubversionAn annoucement went to the Subversion mailing list yesterday that the new book in the Pragmatic Programmer Series, Pragmatic Version Control Using Subversion is now available.
I’ll definitely be picking this one up, as I am a big fan of the “pragmatic” series of books. Once I receive it and read it, I will post my impressions of the book.

More information is available at pragmaticprogrammer.com. As an FYI Amazon has this available, currently, for preorder only.

Practical Subversion by Garrett Rooney

Practical SubversionI received an advanced copy of Practical Subversion by Garrett Rooney and read through it over the weekend. Mr. Rooney is a contributor to the Subversion project and has authored the latest book about the software.

Before I actually talk about the book, I think it would be helpful to point out that while I did receive an advanced electronic copy of the book in order to review it (probably due to other postings related to Subversion on this site) I am not being paid to review it. My interests in agreeing to read the book and write about it are solely to point out valuable resources to help people looking to implement Subversion in their environments, not to get paid. As I’ve written before in previous postings, version control and software asset management is an area that I see missing in many corporate software development environments (and worse than that, in many developers skill sets) and an area that I find very important from both a quality and team productivity perspective. My interests lie in highlighting this and pointing out books and tools that help people implement these tools in their environments.

Now with that out of the way, let’s talk about the book. In many respects, this book is a lot like the Pragmatic Programmer series of books. The book starts with some history of source control in general and source control systems like CVS and Perforce. He then gives you a brief history of the Subversion project and then spends the rest of the book walking you through using the tool.

This is a great book for beginners and a good reference for those of us who have used it for a while. The subjects covered include “A Crash Course in Subversion”, which is a 46 or so page detailed description of the Subversion commands with scenarios he walks you through, including setting up a repository, checking out a workarea, branching, merging, switching your workarea to another branch, committing and setting properties on files. There are also chapters on repository administration, repository migration, and advanced Apache integration (a chapter that while I knew most of the things covered, I found a few tidbits I didn’t know and am really glad that someone has finally covered this subject from a Subversion Administrator perspective).

Practical Subversion also has a chapter dedicated to Subversion Best Practices. This chapter outlines some of the recommended best practices for version control in general, but in the context of the Subversion system. It covers subjects such as the use of vendor branches to manage third party source code, using branches, rolling releases, and using test suites to test your code. This is a very good chapter of practical advice to help one manage the concurrent development of software using a source control system.

The section on branching best practices has some good advice but recommends the frequent merging of the trunk over to branches in order to ensure you are developing and testing the change in the context of the work going on in the rest of the project. While this is good advice, it also introduces other problems which aren’t covered. Subversion does not currently have merge tracking support, and in many instances in which you do frequent merges from the trunk to the branch in real life, you will run into conflicts when merging the branch changes back to the trunk where changes appear in both the trunk and the branch. In practical use, we have found that in order to do this effectively, the developer has to keep track of the revisions in his branch that resulted from trunk merges and merge around them when merging back to the trunk in order to effectively implement this best practice. Once the tool supports merge tracking this shouldn’t be an issue and is definitely a practice that should be followed. If you have dedicated staff to keep track of this stuff, this is the best way to do it. Your average developer, however, does not really want to learn enough about the tool to do all of this record keeping and you may hear frequent complaints about the extra work involved when doing frequent merges from the trunk to your development branches in real life.

Chapter 7 of the book cover topics such as integrating Subversion with existing tools, such as the bash shell, emacs and Ant, along with using Subversion on the OS X platform. It also covers other tools available for use with Subversion such as ViewCVS and SVN::Web. Finally plugins for Eclipse and Visual Studio .NET are briefly covered. This is a great addition to the book and something that I wish I had had during my initial planning of my Subversion rollout.

Finally, Chapter 8 covers the use of the Subversion API. This chapter starts off covering the use of the Apache Portable Runtime libraries relevant to Subversion and then covers the client, repository access and file system APIs. This chapter in and of itself is worth the price of admission in my opinion. This chapter is mainly for those who want to take advantage of the application libraries that the Subversion tools are written around and write their own tools around the Subversion tool. The Subversion team has done a great job of documenting the Subversion system as a whole, but the API documentation is sorely lacking and this chapter gives a really good high level overview of the API’s and how to use them.

Overall, I really liked the book. As I said earlier, this book reminded me a lot of “Pragmatic” series of books. It really is “Practical Subversion”, catering to both beginning and advanced users alike. The book will definitely be a great addition to my library and I recommend it for those who want to implement version control quickly in their environments. This book does not replace the Version Control with Subversion book, but it’s a great addition to it.

The only thing missing from this book that would make it completely indispensable is a chapter on setting up an automated build system with Subversion, using tools like CruiseControl. This small thing aside, there really isn’t anything missing from this book to get your development group up and running on Subversion.

Subversion 1.1.1 released.

The 1.1.1 version of Subversion has been released. This release fixes the performance problems introduced between rc3 and 1.1 along with some other fixes. The official announcement with a detailed list of changes can be found here.

The distribution tarballs for this release can be found by following the links below:

http://subversion.tigris.org/tarballs/subversion-1.1.1.tar.gz
http://subversion.tigris.org/tarballs/subversion-1.1.1.tar.bz2
http://subversion.tigris.org/tarballs/subversion-1.1.1.zip

Subversion 1.0.9 released.

Subversion 1.0.9 has been released. This version fixes a performance issue inadvertantly introduced in 1.0.8. The team is recommending that you upgrade to 1.0.9.

The 1.1.0 release apparently suffers from the same performance issue and a 1.1.1 release is in the works.

Subversion can be found at http://subversion.tigris.org

The official announcement for this release can be found here.