It looks that eventually we moved our project to a bad branching strategy - "Cascading" (in question "TFS -- Sustainability of Cascading Branches" it was recognized viable actually). Now, after reading few articles and seeing it leads to infinite branching tree, I realized that it's bad and want to fix it. But it's not so easy as I expected. TFS allows merges only with parent branches (siblings merge isn't possible).
Here is the diagram of our current branches hierarchy:
Looks weird, but it all started from small changes in latest release
branch while trunk has been suspended in the middle of 3-month work. Then we made few internediate releases one based on previous one (up to 1.1.4). But when we started release 1.2.0, the story with trunk
repeated and we must have suspend 1.2.0 and implement 1.1.5 hotfix.
Now I faced the need of merging 1.1.5 changes into 1.2.0 branch which isn't possible directly. I can only merge 1.1.5 with 1.1.4 which I wanted to avoid (who knows maybe we'll need to implement 1.1.6 based on 1.1.4 tomorrow). But it seems I have no other way out. Still it will be possible to create 1.1.6 branch from non-latest revision of 1.1.4.
Is it what I must do and isn't there a better way out?
And now comes big troubles and the main question. Eventually I'll need to merge all changes into trunk
. And 1.1.5-1.2.0 problem is just a miniature copy of that. That's why I'm asking an optimal and least risky way to perform this merge.
My current plan is the following:
- Create branch "1.1.4 final" with the latest stable released version.
- Optional: Create similar final branches for all previous numbered releases. Should I do it? Most likely I won't need that versions in the future anymore.
- Merge 1.1.5 into 1.1.4
- Merge 1.1.4 into 1.2.0. There wasn't much changes in 1.1.5, so I shouldn't run into problems here.
- Merge 1.1.4 into 1.1.3, 1.1.2 and downto the
release
branch. Should I expect conflicts or problems here? I expect and hope not. - Merge
release
intotrunk
. Most scary part =) - Stabilize code in
trunk
. - Now it is time to create a better branching strategy... I'm very unsure about this part at the moment.
- Create new "
stable
" (Main) branch fromtrunk
- Reparent
trunk
to become child ofstable
. This solution is suggested in related question "How to fix TFS incorrect branching" - Should I remove current "
release
" and "R***
" branches, or leave them as garbage? - For next comming releases do not create separate branches - instead label the final revisions in stable branch. Actually "
stable
" branch will consist only of final release checkins. - I'm NOT going to create the "
integration
" branch for QA of stable features - currently we all live in single active branch without problems. - Create "
alternate
" branch based onstable
for paralel development in case we'll need to once more suspend current work to make some urgent fix. Should I keep single alternate branch forever, or delete it once merged and create a new one (like R125) when again needed?
The idea of this change is to have fixed limited number of branches (ideally 2, at most 3-4).
Please share your thoughts and concerns on my strategy, or propose a better one. I'm asking because not sure it all will work as I expect, don't know if it's the easiest way, and the mistake cost is huge.