[p4] Guidelines for codelines?

Rick Macdonald rickmacd at shaw.ca
Fri Nov 21 13:22:42 PST 2008

There's something I'm missing when some people say branching from the 
mainline causes more merge/integration work or problems than working 
directly in the mainline.

If I have a task that takes me two weeks, when I'm done, I cannot submit 
my changes to the mainline until I merge the new mainline changes from 
the last two weeks unto my workspace. The required merge is initiated by 
a sync operation. I think p4win used to called this something oblique 
such as "Schedule files for resolve".

If I have done the same two weeks of work in a branch, I have to do the 
exact same merge of the new mainline changes before I can put 
(integrate) my changes to the mainline.

Both cases are in fact "Merge down - Copy up" activities. I don't see 
any negative difference to using the branch. There are many advantages 
to working in the branch. Many have been mentioned. One has not. If the 
work is in a workspace directly off the mainline, you can't submit the 
files until the merge/resolve is done. If the resolve goes badly, I'm 
not sure if you can undo it and get back to the state of your files 
because that state has never been submitted. Even if you can, it's still 
scary to me. When working in a branch, you can submit all you like. You 
have a record of your code changes that are safely recorded into the 
branch history before you start messing with the merge. For me, this is 
no small benefit.

How is it any better, safer, easier working directly off the mainline? I 
don't get it.

I must say I make changes directly to the mainline often, but only when 
the change is on a very few lines of code (often just one file), all 
done/tested/updated in a very short time (like an hour).


More information about the perforce-user mailing list