Skip to content

jslhcl/git-cc

Repository files navigation

git-cc
======

Simple bridge between base Clearcase and Git.

Warning
=======

I wrote this purely for fun and to see if I could stop use Clearcase at work
once and for all. At this time I haven't given it a proper run through its
paces, and so BE WARNED!

I will probably continue to hack away at it to suite my needs, but I would
love to see it get some real-world polish. (Actually what I would love to see
more is for Clearcase to die, but don't think that's going to happen any time
soon).

Suggestions on anything I've done are more than welcome.

Workflow
========

Initialise:

gitcc init d:/view/xyz
gitcc rebase 
# Get coffee
# Do some work
git commit -m "I don't actually drink coffee"
gitcc rebse # very VERY important
gitcc checkin

Configuration
=============

You need to add a mapping for each user in your clearcase history to users.py.
You can also limit which branchs and folders you import from.
eg. .git/gitcc

[gitcc]
clearcase = D:\views\co4222_flex\rd_poc
include = FolderA|FolderB
branches = main|ji_dev|ji_*_dev|iteration_*_dev

I would have put this in the .git/config file except python didn't seems to like
reading it.

Behind the scenes
=================

A smart person would have looked at other git bridge implementations for
insperation, such as git-svn and the like. I, on the other hand, decided to go 
cowboy and re-invent the wheel. I have no idea how those other scripts do their
business and so I hope this isn't a completely stupid way of going about it.

I wanted to have it so that any point in history you could rebase on-top of the
current working directory. I've done this by using the clearcase commit time
for git as well. In addition the last rebased commit is tagged and is used
to limit the history query for any chances since. This tagged changeset is
therefore also used to select which commits need to be checked into clearcase.

Problems
========

The big problem I struggled over is the one of syncing your changes with
clearcase. Sure, I can get them into clearcase easily enough, but when it comes
time to rebase again the timestamp is too old and so you (keep) picking up your
own changes, until someone else checks in. This isn't a big problem as the files
aren't modified so git does nothing. I could blow each change away as I commit,
and then rebase, but ideally the git working directory remain untouched. If
anyway has any good ideas I'm all ears.

Also, the error handling is abysmal. Basically I don't do any.

Have fun

About

Bridge for Git and Clearcase

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%