A site devoted to discussing techniques that promote quality and ethical practices in software development.

Sunday, June 3, 2007

"Pragmatic Version Control - Using Subversion" by Mike Mason

Review

This is a must read book for anyone starting out to use Subversion the first time. It is not a book for a novice but for someone who has uses other VCS. SVN is like any other software tool that it has its own view of using it effectively. Failure to understand this can lead to frustration and costly time loss.

This should be treated as a supplement to the Subversion book as this book is a how-to book in using SVN properly.

SVN has its own kind of idiom because "SVN organizes everything by directory" in the repository. These directories does not necessary have corresponding physical directories in the file system. However, to help one to keep track of branches and tags, it is recommended that one tries to map these to physical directories.

These directories in the repository are virtual and does not incur real storage cost. When you issue command to a branch, nothing really is copy until files are changed. There are there to help one to organize the projects and to manage their versions.

The other issues is that the revision number is like a transaction number. Every transaction, like creating a directory in the repository, incurs a new transaction id. In other VCS, this is not so.

For those that have already had exposure to other VCS can jump pretty much into Chapter 7 "Organizing Your Repository". It is always a good idea to start off in the right foot even though SVN has commands to rescue you, see Chapter 6 for some of the operations.

In SVN, Branch and Tag, while similar, have different usages. Tag is a symbolic name for a set of files and "Tags are really useful for keeping track of important events in the life cycle of your project". A branch represents a fork in the history of the repository. Branching uses "cheap copy" of the files as they were when the branch was made. When you check in a change to the files on the branch, Subversion remembers the changes.

The book provides a very thorough coverage of using Branch and Tag properly in Chapter 8 "Using Tags and Branches". It even takes the reader through the journey through a short software life cycle showing how to use SVN properly in each stage. You are encouraged to read that.

It has provided a naming convention for using tags and branch and the author recommends one should apply this consistently across all projects.

After reading Chapter 8, don't just dive into using SVN like you used Visual SourceSafe or other VCS. You are recommended to read Chapter 9 "Creating a Project". This chapter discusses the pros and cons various layout schemes of projects, branches and tags in a non-trivial project consisting of multiple sub-projects. It also discusses a very powerful idiom in SVN to allow one project to draw in another project from a different repository.

SVN is very different than other VCS in its use of revision number. It maintains only one number beginning at 1 for the entire repository. Hence it is better to keep unrelated projects in separate repository rather than in one, which would cause the revision number to be seemingly assigned meaninglessly across different projects. In VSS, the revision number is restarted for each project within a VSS database and hence it is customary to have many projects in one database, which is kind of equivalent to a repository in SVN.

Keeping them in separate repositories may give someone an idea of difficulties in using these projects in separate repositories as dependent projects. Contrary to this belief Chapter 9 shows an example of how to use svn:externals properties to link in projects in other repositories at the particular branch or tag. Chapter 9 is definitely a must read book before one starts.

This book is published by "The Pragmatic Bookshelf"

No comments:

Blog Archive