Is Using Branches to Isolate Features Bad?

Lets look at the two of the requirements we have for our development teams:

  • The mainline in version control has to done at all times
  • Work has to be checked in before leaving the office

The second requirement conflicts with the first one which can cause a mainline to be broken for days or even weeks on end. Since we have to be able to deliver from the mainline it has to be functional, stable and optimized at all times.

I’ve been toying with the idea of using branches to isolate the development of features for a while now. The reason for this is pretty simple: It prevents features that are not yet done from entering the mainline. Thus minimizing risk of getting a broken mainline.

After reading a couple of articles from a series on Branch-Per-Feature Source Control by Derick Bailey (and I hope he continuous that series) I decided to take the plunge. One the systems I architect for had to do some serious refactoring in order to improve performance. Using branches to isolate those changes from the work being done on the mainline would minimize the risk of missing our deadline.

Recently Martin Fowler also wrote a piece about feature branches. He makes the point that when using feature branches you either get a dangerous merge at some point because somebody has to integrate a lot of changes or various branches start integrating without using the mainline (which he calls Promiscuous Integration). His preferred solution is putting more thought into the design in order to Branch By Abstraction. I agree that this is a good idea, I don’t think it solves my original problem.

What is your your opinion and/or experience on this topic?

One Response to “Is Using Branches to Isolate Features Bad?”

  1. Hans Says:

    We've been using Subversion as our SCM with no locking. Working without locking has a big upsite to it, you do not have to check in stuff you are still working on. (If you are the only one working on a change/feature this work fine)

    In the last 2,5 years we been using feature branches to achieve BIG fixes, that could potentionally f#ck things up in a big way and might not get merged back into the trunk before our deadline because of various reason the main usually being it is nog yet finnished.
    One of the things we learned, that its better to merge changes quite often as apposed to a BIG bang strategy.
    The are problems with using branches which we have not found a solutions to (nor did we try) our buildserver does not DO branches only Trunk and the last branch (which is our version currently in production)

Leave a Reply