Software Branching

Software branching is an important sub-process of the overall software development process. The practice that we follow at DMMD is shown in the following figure.

In the above figure, time progresses from left to right and it is recorded using a changelist. A changelist is a number that increases each time a new submission to the software repository is made. Thus, a repository submission with a changelist of 12023 means that it was made before a repository submission of changelist 12050. The branching methodology then follows these rules:

The Main Branch. The main branch, shown in black, is considered the golden standard. It is the branch from which all of the release branches are made and into which all the experimental branches are integrated. The main branch is a single branch. The main brunch is sometimes called the trunk, as in the trunk of a tree with branches.

The Release Branch. The release branch always starts off the main branch. A release branch starts off with a MAJOR release. Once a major release is done, no new features are added to the release branch. All new features are added only to the main or experimental branches. The release branch has a finite lifetime and it is extended only when a bug is fixed in the released version. When a bug is found in the release branch, the bug is fixed in the release branch first (changelist 12023) and then it is integrated into the main branch (changelist 12050). If new releases have been made, before the bug fix is integrated into the main branch (changelist 12050), then the bug fix is integrated into all the release branches (changelist 12051) that have been made before the integration of the bug fix (changelist 12050). The key is that all bug fixes are immediately integrated into the main branch and from the main branch they are integrated into all the other branches.

The Experimental Branch. The experimental branch is used when new features are tried, or when code experiments are made. The experimental branch must always be eventually integrated back into the main branch. An experimental branch cannot take a life of its own, independent of the main branch.

Branching when a project contains several different components, is a bit more complex and will be discussed in the next entry.

– Darian Muresan