tags:

views:

37

answers:

2

Hi all,

I want to introduce the following branching model in my project

version1 -> version2 -> version3 -> version4 -> etc.

so 1) There is no trunk 2) Each version is branched from the previous one

Isn't going to be perfomance issue here linked to constantly increasing "branch depth"?

Thanks in advance

A: 

No. We regularly do something very much like this. When we deploy a version to production, we make a branch to save the state exactly as it went to production. Then trunk becomes our next regular release. But if, as often happens, there is a bug or some other hot fix, we make a new branch off the production branch. When the next hot fix comes along we make a branch off the previous hot fix branch. Etc. So like, say we have branches/Release-10. Then we have a hot fix, so we copy Release-10 to Release-10-1. If we have another hot fix, we copy Release-10-1 to Release-10-2. Etc. I haven't seen any particular problem with this scheme. (We do have to merge the hot fixes back into trunk, but I'd think with any scheme you'd end up having to do that.)

When you copy a branch, SVN doesn't really copy everything. It just copies pointers. One of SVN's boasts is that the cost of making a branch is very small.

Jay
>we copy Release-10-1 to Release-10-2Yes that's what we do also. So branch depth is ~ 1-5
maxim_ge
But in suggested scenario we would have branch depth 84 1->2->3-> -..-> 84. since we have version 84 now. Do you think it will be ok ?
maxim_ge
In other words now distance between branches and trunk is 1-5 "steps". What if it would become tens and hundreds steps ?
maxim_ge
+1  A: 

baseline approach is superior to promotion model

I would consider the "Promotion Model" where one version is based directly on its predecessor as an anti-pattern. However it will not create major performance problems. As long as you do not have distinctive parallel development you can live well with it. As well even as with the "standard" baseline model. It worked for me in the past on a pretty linear project.

It will get harder though the longer you need to maintain versions and the more multiple versions you have at your hands. It will require more policies to implement regarding branch stability and desired change propagation resulting in a significant and not necessarily linear increase of management overhead.

You have potentially more merges that are more difficult to track too. Discipline to check in bugfixes only into to the latest version is crucial in your scenario.

Using the branch layout you described, in a big team you could never be absolutely sure you are not leaving a change "behind" that you need in the future as you are constantly cherry picking and your branches never come "together". That is why I like to call it the "error promotion model" whereas in the mainline based approach the worst thing that could happen is a fix is missing in one future version, not in all of them.

Use the baseline approach. It is battle proven and can very well represent the versioning you seem to have in mind. Remember "copy up, merge down" and maybe read up on the "tofu scale" :)

in a nutshell:

trunk
branches
  1
  2
  3
tags
  1.0
  1.1
  1.2
  2.0
  2.1
  • develop unstable things in the trunk
  • branch from trunk into a maintenance/release-branch ("2" for example)
  • stabilize and test it
  • create a tag 2.0
  • release the tagged code
  • commit bugfixes to "2"
  • test again
  • create tag 2.1
  • release tagged code
  • merge down ALL changes from "2" to trunk
  • merge into "1" if version 1 is still maintained
  • tag 1 as 1.2
  • release from tag

I recommend this (old) but very valid read: http://www.vance.com/steve/perforce/Branching_Strategies.html

Christoph Strasen
Well, very clear. From othe hands compare your baseline steps with promotion ones(1) commit issue/bugfix into branch(es) specified in issue tracker(2) when branch is stable - release it from branch(3) tags are not necessary but you can create them for each release
maxim_ge
Easy if you dont have other branches to maintain at the same time :)It looks simple but it will bite you in the ass when your process has to scale.
Christoph Strasen