15.10.2020, 13:30, "Leam Hall" <leamhall@xxxxxxxxx>: > On 10/15/20 5:55 AM, Konstantin Tokarev wrote: >> 15.10.2020, 12:51, "Leam Hall" <leamhall@xxxxxxxxx>: >>> 1. Two developers. >>> Dev A is working on Branch A, off a release_candidate branch. >>> Dev B is working on Branch B, off the same release_candidate branch. >>> Branches usually run 1-4 weeks. >>> Dev A does some work that would help Branch B. >>> How does Dev A get the Branch B work that is needed, in a >>> way that does not confuse the merge process at the end >>> of the release cycle? >> >> Avoid long-living branches and integrate atomic parts of work into base >> branch as soon as it's done and reviewed. > > Unfortunately, for some tasks 1-4 weeks is atomic. The review process is > being improved as well. We still need a way to integrate the > longer-lived branches cleanly. We've already had issues where attempts > meant lost code. > >>> 2. One developer. >>> Working on Branch P, realizes that a new functionality X is >>> needed. >>> X isn't specific to Branch P, but critical to it. >>> What is the best way to deal with X, knowing that further work >>> on X will need to be done? >> >> Rebase P to the top of parent branch after X is integrated (see above). > > Ah, so "Stop work on P, Resolve X, Rebase P from updated parent"? Let me > go read up on that, it makes sense. If there are two developers, first working on X and and second working on P it may be possible to reduce or avoid stopping second developer at the cost of possible additional conflict resolution later. 1. If X is close enough to finished state so it's API won't have big changes, you cherry-pick X to P and continue work 2. When X is finished and merged to parent branch, rebase P to updated parent 3. If during rebase you hit conflict on patch X, just skip it (it's already in parent) 4. If you hit conflicts in patches following X, you resolve them according to changes done to X after you cherry-picked its intermediate revision. -- Regards, Konstantin