17 messages in com.perforce.perforce-user[p4] Branching policies
FromSent OnAttachments
Robin Charlton14 Nov 2003 06:08 
Noel Yap14 Nov 2003 06:38 
Ivey, William14 Nov 2003 06:49 
jab14 Nov 2003 07:06 
Hoff, Todd14 Nov 2003 08:20 
Hoff, Todd14 Nov 2003 08:31 
Noel Yap14 Nov 2003 08:34 
Noel Yap14 Nov 2003 08:50 
Hoff, Todd14 Nov 2003 08:54 
Noel Yap14 Nov 2003 09:03 
Hoff, Todd14 Nov 2003 09:04 
Noel Yap14 Nov 2003 09:17 
Chuck Karish14 Nov 2003 09:33 
Kevin Wang14 Nov 2003 10:15 
Noel Yap14 Nov 2003 10:23 
Wilbur, Curtis L. SDX14 Nov 2003 10:28 
Stephen Vance14 Nov 2003 14:13 
Subject:[p4] Branching policies
From:Chuck Karish (kar@well.com)
Date:11/14/2003 09:33:18 AM
List:com.perforce.perforce-user

At 02:08 PM 11/14/2003 +0000, Robin Charlton wrote:

We're just about to migrate to Perforce and are working out exactly how best to use it. I'm interested to know what branching policies people use.

Examples that spring to mind include:

* main development branch * branch per release - from the main development or a previous release branch. - used for shipped releases.

You only need a branch for a release that will be actively maintained and from which you will make further releases that will be maintained. The leaves of the code tree can be milestones along a branch rather than having their own branches.

* branch per developer - from the main development or a release branch. - a private work area for a user's main work.

If you do this everybody has to be a conscientious branch manager, doing whatever merging is needed to pull from the parent branch before each submit. I make it clear that every has a sandbox in which this can be done, but it's not part of the normal development scheme.

* branch per feature or bug - from the main development or a release branch. - possibly shared between developers.

Make a branch only when it's necessary to isolate groups that would get in each others' way. The more project branches you have, the more work you're going to have to do to stabilize the main line after each code delivery from a project branch and the more opportunities there'll be for mistakes to be introduced by incorrect merges.

One practice that I've seen work well is to have a shadow main branch that receives code from the project branches. Changes aren't moved to the stable main branch until they've proved themselves on the shadow main and until the product managers have approved the feature or fix for the upcoming release.

The goal is to always have the main line be stable and releasable. Some people would choose to merge code deliveries from the project branches directly into main, to avoid doing baseless merges. This has the disadvantage that the main line is usually in an unstable state, making it difficult to pull new branches from it and making it difficult to integrate changes through it for the benefit of the maintenance branches.