Version 1.1
By Doug Fierro
fierro@rational.com
supplement to presentation #CCM11
Branching- that one word in the software development world can evoke a variety of responses. Some people love branching- they say they couldn't live without out it. Others are not so fond of it- a necessary evil at best. Their faces may show visible pain upon discussing the subject.
Most likely the people who are very favorable towards branching have used tools which greatly facilitate the branch/merge process of development, like ClearCase. The rest are probably still using legacy version control systems, or commercial tools based on technology that does not handle branching and merging well in a team environment.
The ClearCase branch/merge model is one of the most elegant features of the product. Any site not taking advantage of the ClearCase branching features to some extent is short-changing themselves and their development community from realizing the full potential of ClearCase and moving towards true parallel development.
Before ClearCase, branching was at best a manual and tedious process. Most shops stayed away from branching because they did not have the necessary tools in order to completely implement parallel development. It was hard enough to know the right place to branch from in one file, let alone several files being modified at once. The branch name provided to you by legacy version control tools was a numeric sequence identifier, and did not have any built in merge capabilities to speak of. Even if the merges were trivial, identifying all the files that are candidates for a merge was a task within itself. Forget multiple branch merges or subtractive merges or sibling merges - most sites would be happy to have any type of automated merge supported.
Most developers who have encountered traditional version control tools like SCCS or RCS have maybe tried a branch and merge on their own, just to say they have done it, and then never visited the topic again. To describe the process as error-prone is an understatement. There is much manual copying, editing, and diffing that takes place using legacy version control systems if you want to merge.
With ClearCase however, much of the tedious and manual work associated with branching and merging goes away. ClearCase uses an intuitive branching model that is natural for the developer to use. When a user wants to modify a file, the branch is dynamically created at the appropriate version on checkout, and ClearCase uses a named branch to describe the task, all in a transparent workspace. Built-in merge tools can graphically walk a user through a point-and-click solution, making branching and merging "fun". And ClearCase treats directories as first-class objects, which means they can be checked out and checked in, branched and merged just like a source file.
The goal of this paper is to introduce ClearCase users to different types of branching methodologies and terminology, and to provide examples so that a site may come up with their own solution for branching that fits their requirements best. Known best practices as well as common pitfalls will be discussed so the reader is aware of the pros and cons of different branching strategies.
Since most new users to ClearCase have not rigorously implemented branching/merging in their previous tool environment, or may have avoided parallel development entirely, some of the advanced features of ClearCase branching might be difficult for beginners. That is why it is important to cover the basics first.