Skip to content
lightyou edited this page Aug 30, 2016 · 2 revisions

This page goal is to describe the internals of git-cc in order to manage the degraded cases (anything going wrong during rebase or checkin). This is my understanding of the behaviors and should not be taken as truth but more as a guideline to go further.

The hypothesis is that master is the synchronized branch.

Files

Configuration

Configuration is stored in .git/gitcc file. It is an ini file containing one section by branch to be synchronized with clearcase.

.gitcc

This file contains the clearcase elements matching the last synchronisation clearcase -> git it contains one line per clearcase element (file/directory), with the full clearcase path of the element (@@/main/... notation)

lshistory.bak

Branches / Tags

For each synchronized branch, gitcc creates a branch_cc branch and a branch_ci tag.

branch_cc branch

This is used as a mirror of clearcase. It contains commits for each clearcase checkin/checkin group. When rebasing, the date of the more recent commit is used as starting point to get clearcase history in git. This branch do not contains local changes.

This branch is update by following commands :

  • rebase
  • reset

branch_ci tag

This tag mark the common commit between clearcase and git. It is updated when doing a checkin to mark the last commit ckecked-in in clearcase

This tag is updated by the following commands :

  • tag
  • reset
  • checkin
  • rebase

Functions

init

Initialize a new link between clearcase and git. Git repo shall be empty.

Next command can be :

  • rebase : Get full history
  • sync : Get clearcase files in a single commit

rebase

This function rebase current work on changes which append in clearcase

  • Get the more recent changes in clearcase in master_cc branch
  • Rebase local branch on master_cc
  • move master_ci on last rebased commit

checkin

This function push the more recent changes to clearcase (between master_ci and master). A rebase (or tag) is necessary beforehand.

sync

Copy file from clearcase view, without creating a commit. Files will be left changed in current branch.

reset

Reset hard master_cc branch to the specific commit

tag

Move the master_ci tag to the specified commit

update

Same as sync, be create a commit with the changed files

version

Return the current version