2

Assume the following scenario. Lets say you have a file called foo.bar. It has a main branch and a release branch (lets call it r1). r1 has not yet been released, but the developer needs to work on a new project based off of r1. So we branch r2 off of r1. r1 finishes and needs to merge to main to be released. Can you merge r1 to main before finishing/merging r2 (do all children branches need to be merged into the parent, before the parent merges to main)? Our current policies do not allow us to merge r2 content into r1. So we would have to merge r1 to main then r2 to main. Is it possible to skip the merge from r2 into r1 and go directly to main if r1 is in main?

We are not sure if this branching/merging scenario is possible. We currently branch everything off of main (no branches off of branches), but this causing issues when release branches are dependent on each other. Example, r2 needs r1's code to compile, but does not need to change r1's code. Currently we merge the code from r1 into r2, even if we do not need to change the code. We were hoping that it would be possible to branch off of a branch so that r2 can inherit from r1 without merges, but we cannot merge r2 back into r1. They both have to merge directly to main. Although the parent branch will always merge to main before the child.

1 Answers1

0

Can you merge r1 to main before finishing/merging r2 ?

Yes, r2 has a starting point from r1, but any operation done on r1 (new version, merges, ...) has no consequence on r2.

Do all children branches need to be merged into the parent, before the parent merges to main?

No.
Those are called "children branches" because they start from another "parent" branch, but that association has no bearing on those children branches.
Even with ClearCase UCM (where the branch hierarchy is enforced by the Stream hierarchy), you could merge r1 without having to merge r2 first.

We were hoping that it would be possible to branch off of a branch so that r2 can inherit from r1 without merges, but we cannot merge r2 back into r1.

I agree. It is possible (set a label on r1 first, and branch from that label)

They both have to merge directly to main

Ok, but you might want to merge main to r2 first, test that everything is still working, and then merge r2 to main.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250