views:

659

answers:

3

I am currently working on ClearCase and now migrating to GIT. But we need this migration in a way that all work will be done in GIT and the data will be synced backed to ClearCase stream. We will have the same branch names and stream names in both GIT and CC, so scripting shouldn't be a problem. The problem here is,

Can someone suggest which is the best model to sync CC and GIT

  1. Have all the Vobs in CC as single repo in GIT, and have the major stream in CC as various branches in GIT. - Single GIT repo (VOBS) and many branches (CC streams). - This takes up less space as VOBs are kept as single repo with many branches.

  2. Have important CC branches as independent GIT repositories and each repository having all the CC VOBs. - Many GIT repo for many CC branch - This will take up lots of space as VOBs will be replicated across.

Which do you think is the best way to keep it in sync with ClearCase

A: 

Regarding branches and repos, I would go with one vob == one git repo rule, since git repo is really meant to be used by single project, the same way as for vobs.

As for branches, branch names across vobs/repos should match. Take a look at submodules in git to see if this can be used in your case.

What I personaly would like to see is a mature git-cc backend, which will allow me to use git on my dev-box, while being able to sync with corporate CC repository I am forced to use.

Dev er dev
+2  A: 

Have all the Vobs in CC as single repo in GIT, and have the major stream in CC as various branches in GIT

No and yes

Have important CC branches as independent GIT repositories and each repository having all the CC VOBs

No and No

Re-reading my answer about Git limits, you shouldn't try to cram "everything" in a Git repo.
See also "What are the basic clearcase concepts every developer should know?" for a comparison between ClearCase and Git.

Stream can safely be imported as branch.
But VOBs are not necessarily a Git Repo.

If you are using UCM, I would recommend one Git repo per UCM component.

Anyway, you need to record in your Git Repo a way to know what ClearCase view to use to sync back (through a simple clearfsimport) your data.
The view used for that ClearCase data re-import will be a UCM view automatically associated to the right stream, for the right VOB.


Note: I mention in "How to bridge git to ClearCase?" a simpler solution, but which does not import the all history in a Git repo.

VonC
Thanks this seems to help me a lot. i agree that having all VOBs or all UCM components into a single repo will make GIT take a long time to perform operation especially if it's like 20 gb. can you clarify me on more thing. Lets assume am having one repo for one ucm component/one VOB, but as per discussion am having all important CC/UCM stream as branches in the repo, is it possible for different developers to push to different branches of the same repo simultaneously without having to wait if all branches are in same bare repo?
Senthil A Kumar
@Senthil: yes: you can push any branch in a remote bare repo. Note: if you need several UCM component (i.e. several Git repos) to work with (either reading them or modifying them), you will need one or several main project with submodules (see http://stackoverflow.com/questions/1979167/git-submodule-update/1979194#1979194)
VonC
A: 

While I wouldn't necessarily suggest it as the 'best' way of syncing the two, you can import history and push changes back to Clearcase via my git-cc tool, as mentioned here.

charleso