Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sub-branching in ClearCase?

Tags:

unix

clearcase

When I want to use a branch in CC, I usually put something like this in the config spec:

element * .../first_branch/LATEST
element * .../Main/LATEST -mkbranch first_branch
element * ../Main/LATEST

Now, I want to create a branch that is a sub-branch of the first one. Let's say it's called second_branch (I'm creative today). How would that config spec look like?

like image 452
Amir Rachum Avatar asked Jan 20 '23 18:01

Amir Rachum


2 Answers

To add to Kim's answer, I much prefer starting a branch from a label than the LATEST versions selected by a branch.
That way, I know what 'second_branch' stands from and where it comes from.
(coming from the LATEST of another branch means it comes from a moving point which represents something different as time goes by)

element * .../second_branch/LATEST
element * A_LABEL -mkbranch second_branch
element * .../first_branch/LATEST
element * .../Main/LATEST -mkbranch first_branch
element * ../Main/LATEST

If you set A_LABEL on a view configured to be:

  • at the LATEST of 'first_branch'
  • at a 'stable' state

,then you can branch from a known point.

like image 54
VonC Avatar answered Jan 31 '23 09:01

VonC


Like this:

element * .../second_branch/LATEST
element * .../first_branch/LATEST -mkbranch second_branch
element * .../Main/LATEST -mkbranch first_branch
element * ../Main/LATEST

Your view will now look at the latest version on second_branch, or, if it doesn't exist, the latest version on first_branch, or, if it doesn't exist there, the latest version on the main branch. Upon checking out a file, a new version element will be created on respectively second_branch and first_branch as necessarily.

I don't have access to a ClearCase instance right now, so I can't double check your last two lines, but I think that perhaps you meant this instead?

element * .../second_branch/LATEST
element * .../first_branch/LATEST -mkbranch second_branch
element * /Main/LATEST -mkbranch first_branch
like image 23
Kim Burgaard Avatar answered Jan 31 '23 11:01

Kim Burgaard