Branching Strategy Questioned
It is an exciting time for Subversion as its adoption continues at a dizzying pace in enterprises. I'm out there helping that adoption so I'm a bit late in posting the questions and answers I promised around the three basic branching strategies that I covered in the last two webinars in which I presented (Branching and Merging Strategies for Subversion 1.5 and Advanced Merge Tracking and Branching with Subversion 1.5). Hopefully these will be useful to many of you.
First, a quick reminder on what the three branching strategies were:
1. The unstable trunk which mimics the way that Subversion itself is developed. In this model, development is done on the trunk and a release branch is created around the time of feature completion with the formal promotion process carried out on that branch.
2. The stable trunk where development is done on system version branches and the promotion process is also conducted on that branch. The trunk is the branch point where the production releases are merged in and parallel development efforts are branched out.
3. The agile release strategy where development is done on individual feature branches and a release branch is created late in the process with the feature branches merged to it that will define that release. The formal promotion process is conducted on the release branch and the production version merged to the trunk as well as to all remaining active feature branches.
So on to the questions, first general branching questions:
Does the number of branches affect performance of the Subversion server?
No, branches are not just cheap in space and fast to create, they are alo just additional paths not unlike directories in the directory structure of your project. Of course, every tool has scalability issues at some point and Subversion logically has its limits, but in practical use, a scalability issue for Subversion around branches has not yet been experienced.
Can we use multiple strategies on one project?
Absolutely, there are many times when you may find a need to mix at least two branching models on the same project. For example, Internet applications may have very frequent releases focused primarily to address defects along with longer term release efforts to address broader feature development. The frequent releases may follow the unstable branch approach where they are worked primarily on the trunk and are branched, sometimes weekly or even more frequently, to do the formal QA to get to the release. The longer running enhancement releases may use the stable trunk philosophy though obviously the trunk isn’t actually stable, but the rest of the strategy is followed.
What strategy is best for a repository with multiple projects?
There is no need to have a single strategy in such a case. Instead one should use the appropriate method for each of the projects. Since each project should have its own top level directory for its branching model, there is no reason to force a particular method on all projects.
How does continuous integration affect branching strategies?
I’d hope that this isn’t the deciding factor in determining an appropriate branching strategy, but certainly the feasibility of continuous integration is impacted by the strategy chosen. With the unstable branch, continuous integration would be focused on the trunk and thus is stable as well as very useful as it identifies issues in the daily development commits. This is still relatively true when you look at the stable branch strategy where there may be multiple system version branches under development at the same time, but each is the focus of the majority of the development commits. The agile release model is the least accessible for this approach because of the number of active branches to try and monitor. That doesn’t mean continuous integration can’t be used but just that it is more difficult to implement and maintain.
Unstable Trunk questions:
Can this model handle parallel development if it only happens occasionally?
Any model can be morphed to handle exceptional situations, but this isn’t recommended. It is important to use a strategy consistently so that everyone understands where to find things during development and historically. That said, we’ve already talked about the potential of using multiple strategies on the same project so that’s certainly a possibility where the parallel development need could be addressed like with the stable trunk strategy.
Do I ever recommend merging from the trunk to the branch?
Never say never, but the situation would be pretty rare. I could potentially envision where a nearly complete bug fix or even an enhancement of importance is completed quickly enough on the trunk that there could be a compelling reason to merge it into the unreleased, but branched version.
How would you handle branches for customers that will have ongoing customizations for individual customers in this model?
Branches for this purpose can really be applied to any of the three basic branches we’ve discussed. The concept is that the base product continues to evolve and the branching strategy addresses that evolution. As production releases are made, the new revisions are merged to the customer-specific branches which contain customizations for that customer. There is also the potential of customer customizations being merged into the base product. The customer branches support the unique nature of customer specific changes while allowing for an upgrade path and the potential of contributing back to the base product.
Stable Trunk questions:
Version 1.0.1 didn’t get merged back into the trunk, shouldn’t it have been merged back?
Possibly, but I actually didn’t do so on purpose. With all the models, there is the potential that multiple releases are deployed in production and thus need to be supported. Therefore, there is the potential that bug fix releases are being made for multiple releases and merging all of them back to the trunk could mean intertwined versus serial releases. I therefore usually suggest that the actual production releases may be the only ones merged. Obviously, in my diagram that situation didn’t occur so it is a fair question.
There is a merge to the trunk outside of a release point, doesn’t that violate the stable trunk idea?
Yes, that can violate the stable trunk concept, but stability isn’t necessarily limited to just production releases. In this case, the purpose is to have a more up-to-date starting point for the system version branch. How strict you implement the idea of stability is up to you.
Should the development team develop the first version in the trunk or in a release branch?
Since my base principle is keeping it simple, I tend to say do the development on the trunk since there is no reason for creating a branch. The assumption is that parallel development won’t happen until the first release is made and other work won’t be merged until the release. This isn’t being pure to the strategy, but true to the base principle.
Agile Release questions:
In this strategy, is there any attempt to keep the task branches in sync with each other?
No, there really isn’t any way to define how you would keep isolated tasks in sync since there is no idea what will be released together until we get to the definition of the release branch. There is a need to keep the branches sync’d with production releases, but no way to do more.
Is there any reason that an Internet application should NOT be using the agile release method?
Sure, there are still many such applications that are released in a waterfall manner and are unquestionably successful. For example, release agility may not be required if releases are being made frequently enough. Keep in mind that there is more to keep in sync in this model which has to be balanced against any benefits.
Where is the release package built from?
I think the package would be built from the release branch since that’s logically where the promotion model process is conducted, but it can certainly be argued that the testing can be done on the release branch and then the approved revision merged to be tagged from the trunk. My absolute expectation is that you be consistent where you do build and tag.
How can a CM manager make sure all task branches were merged to the release branch?
Today, I would suggest the use of svnmerge.py where merge tracking is recorded in a property for all branch merges. Obviously, this will be easier with 1.5 where the log command can expose this information. Another approach would come from integrating issue management with Subversion where the merges would be reflected in the record for the release.
I'm sure I'll return to answer some more questions around these branching models and merge tracking before long. Right now, I'm off to help another enterprise successfully implement Subversion.
Happy Holidays!





Dear Bob,
first of all thank you for the important branching information!
I would like to download your second webinar as I asked already in
http://blogs.open.collab.net/svn/2007/11/what-about-bran.html.
The first webinar (branching.pdf) is easily downloadable in the replay and from
http://subconf.open.collab.net/
Best regards,
René
René Leonhardt | November 30, 2007 at 01:55 AM
The link for the second webinar is in both postings and appears to work for me. Nonetheless, the URL is http://www.collab.net/webinar22/.
Sorry I failed to respond to the earlier request.
Regards,
Bob
Bob | November 30, 2007 at 05:45 AM
Hi, thanks for the post. Any idea (even rough) as to when Subversion 1.5 might be released?
Thanks,
Jeff
Jeff Benson | December 03, 2007 at 07:19 AM
First quarter of 2008 roughly. Until release 1 of 1.5 emerges, everything is particularly speculative about a production version. Release candidates go through 4 week soak periods in which high priority issues are identified and then addressed with a new release candidate. When a release candidate is built that doesn't have such issues during its 4 week soak period, then we have the production release.
Regards,
Bob
Bob | December 03, 2007 at 09:01 AM
I remember that 'rough' estimate pointing at December '07 not so long ago :) But I do realize stability is key here and know the team's working hard on that.
I was always wondering on the right strategy for Agile branching and this post is the first place ever I see it explained. Thank you for that.
Michal | December 06, 2007 at 11:39 AM
Thanks for the estimate, Bob! We're a 5-person team hoping to migrate from SourceSafe 6.0 soon, but it seems like it might make sense for us to wait if 1.5 is a major release.
Thanks,
Jeff
Jeff Benson | December 07, 2007 at 11:49 AM
I am not sure if I am reading it correctly (and your bullets with arrows are not helping clarify the images at all -- do you mean the bullet corresponds with the line the arrow points to?), but if I am then it does not cover typical open source use of SVN.
In most projects development occurs on trunk and when it is time to cut a release for the first time (say 1.0) a branch is made for the 1.x series. Subsequently after this is created a tag is made for 1.0. Development on trunk continues towards 2.0 and 1.x is used as a branch to apply only security and bug fixes, tagging as necessary for 1.1, 1.2, and so on. When the time comes for 2.0 another stable branch is created for 2.x and a tag for 2.0 is made. Development continues on trunk for 3.0 and the 2.x branch (and 1.x depending on support protocol) will get security and bug fixes. And so on, and so on.
Like I said, if this is what you intended with the stable trunk strategy then the image really needs more clarification. The way those bullets and arrows point really leave a lot of ambiguous interpretation.
Jeroen Ruigrok van der Werven | December 14, 2007 at 02:14 AM
The Subversion model (or general open source model more accurately) is what is being shown in the unstable trunk model. I guess you're reading the tags as referring to the point where the merge is done to the trunk, but the intention is that they refer to the source of the arrow and thus the tagging is done on the release branch. The merges are shown to emphasize the need to keep the trunk updated with work on the release branch at least at the points of releases.
I'm not sure if there is a way to eliminate potential ambiguity without just more text as the approach is consistent through the models so as a group the potential ambiguity is minimized as best it can be. If each is taken in isolation, then you're right about the ambiguity.
Thanks for the feedback.
Bob | December 14, 2007 at 12:34 PM
Some "just curious" questions from one of the Mindless Masses:
1. Is it correct to say that .NET competes with Subversion?
2. Any idea what percent of Java development/maintainance is done on .NET?
3. Do any web developers use Subversion to maintain web content [HTML; Java; whatever.]
4. Does Subversion integrate well with Google Widget Toolbox? [or are Google Widgets preemptively non-collaborative therefore needing little version control?]
Would be interested in any responses, including "have no idea".
harry wertmuller | January 19, 2008 at 03:11 PM
I see nobody has answered you... Probably by now, you have a better idea of your questions, but I'll answer anyway:
1. No, it's not correct. .NET is many things, but it is not primarily a source control system. I'm sure there are many people out there using .NET who keep their .NET assets in a Subversion repository.
2. 0%. Java is not a .NET language. J# is a Java-like language which is part of the .NET family. Java developers may also integrate various .NET libraries into Java, in various ways. They may also use various .NET tools in their work for various purposes. However, I wouldn't describe any of these activities as "doing development/maintenannce on .NET".
3. Yes. Subversion does a good job of tracking the revisions of your web site. Subversion tracks file assets and their revisions; it really doesn't matter what purposes those assets are being put to.
4. I don't know what you mean by "non-collaborative" here, but certainly, GWT widgets are defined in files, and are changed, often by multiple people. Even if by a single person, tracking change history is highly valuable. I don't recommend that ANYONE attempt serious development (even non-software) of ANYTHING without a serious revision control system to track their changes. Subversion handles GWT widgets fine, as well as the pages or programs that make use of those widgets.
Bob Kerns | April 06, 2008 at 03:30 PM