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?