# Re: Getting CVS and Git to play nicely in the same box

5 messages from 2006-11-30 to 2006-11-30. Participants: Jakub Narebski, Alex Bennee, Robin Rosenberg.
Thread: https://gitlist.dev/t/43126

## Alex Bennee, 2006-11-30 12:39

Subject: Getting CVS and Git to play nicely in the same box
Message-ID: <1164890354.21950.92.camel@okra.transitives.com>
URL: https://gitlist.dev/e/1164890354.21950.92.camel%40okra.transitives.com

```
Hi,

I'm trying to get a setup where I can use git for my day to day coding
on problems but still mirror a CVS repo. The situation is muddied
slightly by the way we manage changes in our CVS repository and
baselines.

The CVS manner of working means we create a branch at a given point to
do work on it:

          BL1_CH2
         /
        /
       BL1_CH1
BL1---/

And then in the meantime a new baseline may be released:


BL2    BL1_CH2
|     /
|     BL1_CH1
BL1--/

So we employ the "cvs -q update -dP -j BL1 -j BL2" on our development branch
          
          BL2_CH2
         /
BL2     BL1_CH2
|      /
|    BL1_CH1
BL1--/

I want to mirror this sort of behaviour it git (basically making the 
cvs -j -j operation a git merge, separate from the normal development track). 
I however also need to maintain the CVS meta-data so when I get to given points
I can commit my work into the main development server.

I can set up a git repo that ignore all the CVS gubbins with exclude info but the
CVS metadata gets in the way. I think I have to maintain two git repos, one that tracks the
baseline and one which is a clone (which can then pull updates) but has the CVS meta data
for my development branch. However CVS does seem to get very confused when the world moves
under it when you switch branches in GIT.

Has anyone successfully set up such a working environment? Can anyone offer any tips on how to
make it all work nicely?

-- 
Alex, homepage: http://www.bennee.com/~alex/
To iterate is human, to recurse, divine.

```

## Jakub Narebski, 2006-11-30 13:08

Subject: Re: Getting CVS and Git to play nicely in the same box
Message-ID: <ekml1n$ask$1@sea.gmane.org>
URL: https://gitlist.dev/e/ekml1n%24ask%241%40sea.gmane.org
In-Reply-To: <1164890354.21950.92.camel@okra.transitives.com>

```
Alex Bennee wrote:

> Has anyone successfully set up such a working environment? Can anyone
> offer any tips on how to make it all work nicely?

Why not use git-cvsserver? Or port git-svn to CVS (or use Tailor)?
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


```

## Alex Bennee, 2006-11-30 13:54

Subject: Re: Getting CVS and Git to play nicely in the same box
Message-ID: <1164894847.21950.98.camel@okra.transitives.com>
URL: https://gitlist.dev/e/1164894847.21950.98.camel%40okra.transitives.com
In-Reply-To: <ekml1n$ask$1@sea.gmane.org>

```
On Thu, 2006-11-30 at 14:08 +0100, Jakub Narebski wrote:
> Alex Bennee wrote:
> 
> > Has anyone successfully set up such a working environment? Can anyone
> > offer any tips on how to make it all work nicely?
> 
> Why not use git-cvsserver? Or port git-svn to CVS (or use Tailor)?

I can't use git-cvsserver because the main repository is going to have
to stay on CVS for the time being. I don't think it could be used as a
drop in replacement for our existing server anyway as it doesn't support
tagging or branching.

Using git is my own personal indulgence (At least until I can
demonstrate it's worth while the other migrating ;-).

It looks like git-svn  is the sort of tool I'd want for CVS although I'm
not sure how it would live with our CVS branched development model. I'll
have a poke around Tailor and see if that offers any help.

-- 
Alex, homepage: http://www.bennee.com/~alex/
Nobody wants constructive criticism. It's all we can do to put up with
constructive praise.

```

## Jakub Narebski, 2006-11-30 14:16

Subject: Re: Getting CVS and Git to play nicely in the same box
Message-ID: <200611301516.22382.jnareb@gmail.com>
URL: https://gitlist.dev/e/200611301516.22382.jnareb%40gmail.com
In-Reply-To: <1164894847.21950.98.camel@okra.transitives.com>

```
Alex Bennee wrote:
> On Thu, 2006-11-30 at 14:08 +0100, Jakub Narebski wrote:
>> Alex Bennee wrote:
>> 
>>> Has anyone successfully set up such a working environment? Can anyone
>>> offer any tips on how to make it all work nicely?
>> 
>> Why not use git-cvsserver? Or port git-svn to CVS (or use Tailor)?
> 
> I can't use git-cvsserver because the main repository is going to have
> to stay on CVS for the time being. I don't think it could be used as a
> drop in replacement for our existing server anyway as it doesn't support
> tagging or branching.
> 
> Using git is my own personal indulgence (At least until I can
> demonstrate it's worth while the other migrating ;-).

Perhaps if not git-cvsserver, then git-cvsimport (or parsecvs, or cvs2git)
and git-exportcommit would be what you want.

> It looks like git-svn  is the sort of tool I'd want for CVS although I'm
> not sure how it would live with our CVS branched development model. I'll
> have a poke around Tailor and see if that offers any help.

Well, Tailor used to work only with linear histories. But it is meant to
maintain parallel repositories in different formats.
-- 
Jakub Narebski

```

## Robin Rosenberg, 2006-11-30 22:21

Subject: Re: Getting CVS and Git to play nicely in the same box
Message-ID: <200611302321.19129.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200611302321.19129.robin.rosenberg.lists%40dewire.com
In-Reply-To: <1164890354.21950.92.camel@okra.transitives.com>

```
torsdag 30 november 2006 13:39 skrev Alex Bennee:
> Hi,
>
> I'm trying to get a setup where I can use git for my day to day coding
> on problems but still mirror a CVS repo. The situation is muddied
> slightly by the way we manage changes in our CVS repository and
> baselines.
>
> The CVS manner of working means we create a branch at a given point to
> do work on it:
>
>           BL1_CH2
>          /
>         /
>        BL1_CH1
> BL1---/
>
> And then in the meantime a new baseline may be released:
>
>
> BL2    BL1_CH2
>
> |     /
> |     BL1_CH1
>
> BL1--/
>
> So we employ the "cvs -q update -dP -j BL1 -j BL2" on our development
> branch
>
>           BL2_CH2
>          /
> BL2     BL1_CH2
>
> |      /
> |    BL1_CH1
>
> BL1--/
>
> I want to mirror this sort of behaviour it git (basically making the
> cvs -j -j operation a git merge, separate from the normal development
> track). I however also need to maintain the CVS meta-data so when I get to
> given points I can commit my work into the main development server.
>
> I can set up a git repo that ignore all the CVS gubbins with exclude info
> but the CVS metadata gets in the way. I think I have to maintain two git
> repos, one that tracks the baseline and one which is a clone (which can
> then pull updates) but has the CVS meta data for my development branch.
You don't need to use GIT to track metadata (I asume you mean CVS/Entries) is 
not necessary. Use a plain CVS checkout for that and cvsexportcommit to it.

> However CVS does seem to get very confused when the world moves under it
> when you switch branches in GIT.
Exaktly. Forget about it, it won't work and there is a simpler solution.

> Has anyone successfully set up such a working environment? Can anyone offer
> any tips on how to make it all work nicely?

My setup is like this:

- A tracking repo on a server runs git-cvsimport every night.
- I pull from the tracking repo
- I have a CVS checkout for the branch I'm interested in committing to
- Then I use cvsexportcommit to export changes back to CVS. Actuallly I use a 
small script that runs cvs update and then exports the changes defined by a 
named commit so I say "tocvs a-commitid--tag-or-stgit-patch-name".

Since I use StGit I get no problem from my changes coming back through the 
cvsimport executed on the server. StGit makes the patches empty when my own 
code returns from CVS.


```
