Do you continue development in a branch or in the trunk? [closed]

I have tried both methods with a large commercial application.

The answer to which method is better is highly dependent on your exact situation, but I will write what my overall experience has shown so far.

The better method overall (in my experience): The trunk should be always stable.

Here are some guidelines and benefits of this method:

  • Code each task (or related set of tasks) in its own branch, then you will have the flexibility of when you would like to merge these tasks and perform a release.
  • QA should be done on each branch before it is merged to the trunk.
  • By doing QA on each individual branch, you will know exactly what caused the bug easier.
  • This solution scales to any number of developers.
  • This method works since branching is an almost instant operation in SVN.
  • Tag each release that you perform.
  • You can develop features that you don’t plan to release for a while and decide exactly when to merge them.
  • For all work you do, you can have the benefit of committing your code. If you work out of the trunk only, you will probably keep your code uncommitted a lot, and hence unprotected and without automatic history.

If you try to do the opposite and do all your development in the trunk you’ll have the following issues:

  • Constant build problems for daily builds
  • Productivity loss when a a developer commits a problem for all other people on the project
  • Longer release cycles, because you need to finally get a stable version
  • Less stable releases

You simply will not have the flexibility that you need if you try to keep a branch stable and the trunk as the development sandbox. The reason is that you can’t pick and chose from the trunk what you want to put in that stable release. It would already be all mixed in together in the trunk.

The one case in particular that I would say to do all development in the trunk, is when you are starting a new project. There may be other cases too depending on your situation.

By the way distributed version control systems provide much more flexibility and I highly recommend switching to either hg or git.

Leave a Comment