2

Currently we use ClearCase UCM.. I am trying to evaluate possibility of using git in our project. I decided to create large repo with past three years changes from an integration stream. The pvob has 12 vobs under it. For purpose of evaluation(creating a worst case), I am putting all changes into single repository.

I want to create a base clearcase view and then adjust its spec for every baseline on the pvob. This will then synched to git repository.

Question in short: How can I create a base clearcase view given a pvob base line and keep changing its config spec to match every baseline?

(academic note : A picture of what I am trying to achieve.. )

enter image description here

(Approach discussed in ClearCase UCM: Is it possible to have a temporary view on any given baseline? is kind of work around in my case. I guess I can avoid the step of creating many temporary streams- not sure how!)

Community
  • 1
  • 1
Jayan
  • 18,003
  • 15
  • 89
  • 143

1 Answers1

2

I am putting all changes into single repository.

This isn't the right granularity for a git repo.
Having done multiple ClearCase to Git migration, the right scale usually is one UCM component equals one Git repo.

How can I create a base clearcase view given a pvob base line and keep changing its config spec to match every baseline?

You don't have to create a base ClearCase view.
You can create a sub-stream to the Int stream, and manage the baselines you want to see there.
(cleartool rebase -bas xxx@\YourPVob)

You can then use an UCM view to that sub-stream as a source for your git import.

If that approach isn't possible (as I explained in my previous answer you mention, because for instance all baselines haven't been created in the same parent stream), then you can create a base ClearCase view and modify its config spec in order to select the baseline complete ids:

element * BaselineId1    
element * BaselineId2    
...

(A dynamic view here is more useful to tweak the config spec.
Once the config spec is set, you can update a snapshot view with the same config spec, and appropriate load rules, to use it as a source for your git import).

You need to make sure those baselines are:

  • full baselines (you can promote an incremental one to a full one)
  • referenced with their id (not their title, which is their visible name).
    See also "Display Current Baseline with Cleartool":

    cleartool describe -l baseline:aBaseline@\aPVob
    cleartool descr -fmt "%[found_bls]CXp" stream:myStream@\myPVob
    

The second command would give you all baselines in a stream.
In both cases, you would see the baseline ids in addition of their names.


I have mention the ClearCase to Git migration aspect in :

A good trick is to use:

git --git-dir=/path/to/git/repo/.git --work-tree=/path/to/ClearCase/view add .

That allows you to consider the ClearCase view as the working tree of your git repo (which is the destination of your import).

I generally don't try to import all baselines from all streams because it is too complex too soon (in order to get the sequence of those histories right).

I just get a few baselines from the main stream, import them and go from there (keeping the ClearCase referential as a read-only archive source for history research).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Okay. I will try that. I thought I need to create one stream per baseline. After reading again (from your answers), it is clear that one child stream and many rebases will do. For the sake of academic interest, is it possible to get base-clearcase view working? – Jayan Jun 07 '14 at 18:16
  • how do I map the baseline on pvob to the baseline ID of vobs? – Jayan Jun 07 '14 at 18:18
  • @Jayan I have edited the answer to address your question about baseline. I mention in that edit my older answer http://stackoverflow.com/a/9696988/6309, which is quite important to read in order to understand baselines right. – VonC Jun 07 '14 at 18:27
  • wow. I did not find the trick mentioned in any other answers. :) That will remove the rsync step :). Thanks for answering this. I am not sure how to edit the question /title to match your answer! – Jayan Jun 07 '14 at 18:28
  • @Jayan the title is ok, since you would still need to configure that base ClearCase view in order to accommodate any UCM baseline. – VonC Jun 07 '14 at 18:31