views:

232

answers:

2

I was reading this post about "branch per feature" and this one too and found myself wondering how many people out there are using this concept? I am all for continuous integration and tagging each check in. And at the end of an iteration I create a special tag set to identify the sprints result. I have never needed to take it further by creating a special branch for each features development.

Question: Does anyone branch their code for the development of each feature in their code base? If so, why do you do that and what are the benefits that you have seen from this process? Do the non-process oriented developers on your team buy off on this approach?

+1  A: 

I haven't heard of such a thing. Seems like an overuse of branching to me. I guess it depends on what we mean by the word "feature". Is it a use case? A user story? An entire iteration?

Branches imply parallel development. If you aren't developing in parallel, why branch?

Some good SCM references from our host, Jeff Atwood:

  1. Eric Sink
  2. Branching and Merging Primer

And, of course, the SVN red bean book:

http://svnbook.red-bean.com/

I also like what "Pragmatic Version Control" has to say about branching and tagging.

duffymo
I agree. I don't see the point to branching on a per feature basis unless it is developed in parallel outside of everyone else's efforts and will not be merged until complete. But why not just develop that feature and continuously integrate into the primary code base as you go? And to do this for every feature?
Andrew Siemer
Because that would be utter chaos in many cases.
Richard Berg
A: 

To me, branching by feature only makes sense when you have a large enough project that you can speak intelligently about the "X feature team" as an independent unit.

Moreover, there are certain size criteria (admittedly fuzzy). If you have 10 developers, you only have 1 feature team as far as I'm concerned -- doesn't matter if two of them are always "the widget dialog guys" or "the database guys." You may very well need >1 development branch if someone is doing a major refactor, making a breaking change to APIs, altering expected behavior such that many BVTs will fail, etc. But that's not a feature branch.

If you have 100 developers, you may need feature branches. It depends how tightly coupled your features are and how disciplined your SCM process is in general, especially with regard to build quality. Even if you don't have feature branches, you'll certainly have some sort of branch hierarchy.

If you're working on Windows, layers & layers of feature branches are a godsend. If the shell team can't be productive because the kernel team introduced a bug, that's a frickin' big problem.

Of course, there's a balancing act to be made. Some large organizations take feature branching too far. When it starts to take months before code blessed by feature team X makes it up to team Y, the pain of merging + integration testing will outweigh the codebase stability you tried to gain in the first place. (hence the phrase "your tree's depth from MAIN is inversely proportional to your sanity") And in every case, the tree for version N must narrow as its release approaches, eventually collapsing to a point where only checkins directly to that release's trunk will be included and every feature branch is effectively targeting N+1.

Richard Berg