# Importing all modules in a CVS repo with git-cvsimport

8 messages from 2008-03-19 to 2008-03-20. Participants: Alex Bennee, Daniel Barkalow, Jeff King, Robin Rosenberg.
Thread: https://gitlist.dev/t/12748

## Alex Bennee, 2008-03-19 18:35

Subject: Importing all modules in a CVS repo with git-cvsimport
Message-ID: <1205951736.24610.3.camel@pitcairn.cambridgebroadband.com>
URL: https://gitlist.dev/e/1205951736.24610.3.camel%40pitcairn.cambridgebroadband.com

```
Hi,

I'm wanting to import the entirety of a CVS repository into git rather
than an individual module. However every approach I've tried to do this
fails as the underlying cvsps tool seems to only be able to deal with
modules rather than the whole project.

Is there any invocation I could do that would do the whole import?

--
Alex, homepage: http://www.bennee.com/~alex/ When angry, count four;
when very angry, swear. -- Mark Twain, "Pudd'nhead Wilson's Calendar"

```

## Daniel Barkalow, 2008-03-19 20:10

Subject: Re: Importing all modules in a CVS repo with git-cvsimport
Message-ID: <alpine.LNX.1.00.0803191602110.19665@iabervon.org>
URL: https://gitlist.dev/e/alpine.LNX.1.00.0803191602110.19665%40iabervon.org
In-Reply-To: <1205951736.24610.3.camel@pitcairn.cambridgebroadband.com>

```
On Wed, 19 Mar 2008, Alex Bennee wrote:

> Hi,
> 
> I'm wanting to import the entirety of a CVS repository into git rather
> than an individual module. However every approach I've tried to do this
> fails as the underlying cvsps tool seems to only be able to deal with
> modules rather than the whole project.
> 
> Is there any invocation I could do that would do the whole import?

A for loop? I don't think it's possible to treat the modules as just 
subdirectories, but you can loop over the modules, importing each of them 
into a separate git repository and then, if you want, merge each of them 
into a new master repository with the "subdirectory" strategy.

	-Daniel
*This .sig left intentionally blank*

```

## Jeff King, 2008-03-19 20:41

Subject: Re: Importing all modules in a CVS repo with git-cvsimport
Message-ID: <20080319204154.GA19556@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20080319204154.GA19556%40coredump.intra.peff.net
In-Reply-To: <1205951736.24610.3.camel@pitcairn.cambridgebroadband.com>

```
On Wed, Mar 19, 2008 at 06:35:36PM +0000, Alex Bennee wrote:

> I'm wanting to import the entirety of a CVS repository into git rather
> than an individual module. However every approach I've tried to do this
> fails as the underlying cvsps tool seems to only be able to deal with
> modules rather than the whole project.
> 
> Is there any invocation I could do that would do the whole import?

What do you want the result to look like? If you have CVS modules 'foo',
'bar', and 'baz', I assume you want a repository with subdirectories
'foo', 'bar', and 'baz'?

In that case, you can create a CVS module that just includes all three:

  cd /path/to/cvsroot
  mkdir all
  cd all
  for i in foo bar baz; do
    ln -s ../$i
  done

and then:

  git cvsimport all

You might be able to do something similar with the CVSROOT/modules file,
but I haven't tried.

-Peff

```

## Robin Rosenberg, 2008-03-20 05:46

Subject: Re: Importing all modules in a CVS repo with git-cvsimport
Message-ID: <200803200646.08631.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200803200646.08631.robin.rosenberg.lists%40dewire.com
In-Reply-To: <1205951736.24610.3.camel@pitcairn.cambridgebroadband.com>

```
Den Wednesday 19 March 2008 19.35.36 skrev du:
> Hi,
>
> I'm wanting to import the entirety of a CVS repository into git rather
> than an individual module. However every approach I've tried to do this
> fails as the underlying cvsps tool seems to only be able to deal with
> modules rather than the whole project.
>
> Is there any invocation I could do that would do the whole import?

You didnt' mention anything about you tried, but I recall that using ',' for 
the module name is possible. Some version of CVS do not like it however
and will bug out.

-- robin

```

## Alex Bennee, 2008-03-20 08:30

Subject: Re: Importing all modules in a CVS repo with git-cvsimport
Message-ID: <b2cdc9f30803200130w11669e51o5b273ee5eba7458@mail.gmail.com>
URL: https://gitlist.dev/e/b2cdc9f30803200130w11669e51o5b273ee5eba7458%40mail.gmail.com
In-Reply-To: <alpine.LNX.1.00.0803191602110.19665@iabervon.org>

```
On 3/19/08, Daniel Barkalow <barkalow@iabervon.org> wrote:
> On Wed, 19 Mar 2008, Alex Bennee wrote:
>
>  > Hi,
>  >
>  > I'm wanting to import the entirety of a CVS repository into git rather
>  > than an individual module. However every approach I've tried to do this
>  > fails as the underlying cvsps tool seems to only be able to deal with
>  > modules rather than the whole project.
>  >
>  > Is there any invocation I could do that would do the whole import?
>
>
> A for loop? I don't think it's possible to treat the modules as just
>  subdirectories, but you can loop over the modules, importing each of them
>  into a separate git repository and then, if you want, merge each of them
>  into a new master repository with the "subdirectory" strategy.

Unfortunately the repository is treated as one big ode dump place so I
don't want to loose the information about changes across many
dirs/modules. I shall try the "fakeing up" approach mentioned
elsewhere and see where that gets me.


-- 
Alex, homepage: http://www.bennee.com/~alex/
Hire me? http://www.bennee.com/~alex/cv.php

```

## Alex Bennee, 2008-03-20 09:58

Subject: Re: Importing all modules in a CVS repo with git-cvsimport
Message-ID: <1206007130.24610.6.camel@pitcairn.cambridgebroadband.com>
URL: https://gitlist.dev/e/1206007130.24610.6.camel%40pitcairn.cambridgebroadband.com
In-Reply-To: <20080319204154.GA19556@coredump.intra.peff.net>

```

On Wed, 2008-03-19 at 16:41 -0400, Jeff King wrote:
> On Wed, Mar 19, 2008 at 06:35:36PM +0000, Alex Bennee wrote:
> 
> > I'm wanting to import the entirety of a CVS repository into git rather
> > than an individual module. However every approach I've tried to do this
> > fails as the underlying cvsps tool seems to only be able to deal with
> > modules rather than the whole project.
> > 
> > Is there any invocation I could do that would do the whole import?
> 
> What do you want the result to look like? If you have CVS modules 'foo',
> 'bar', and 'baz', I assume you want a repository with subdirectories
> 'foo', 'bar', and 'baz'?
> 
> In that case, you can create a CVS module that just includes all three:
> 
>   cd /path/to/cvsroot
>   mkdir all
>   cd all
>   for i in foo bar baz; do
>     ln -s ../$i
>   done
> 
> and then:
> 
>   git cvsimport all

Hmm that fails:

09:55 ajb@pitcairn/x86_64 [test.cvs] >perl /export/src/git.git/git-cvsimport.perl -v -C /export/csrc/import_test/test.git all
Initialized empty Git repository in /export/csrc/import_test/test.git/.git/
Running cvsps...
cvs rlog: Logging .
WARNING: file /newcvs/.cvsignore doesn't match strip_path /newcvs/all/. ignoring
WARNING: file /newcvs/Attic/Make.rules doesn't match strip_path /newcvs/all/. ignoring
WARNING: file /newcvs/Makefile doesn't match strip_path /newcvs/all/. ignoring
WARNING: file /newcvs/Makefile.voip doesn't match strip_path /newcvs/all/. ignoring
WARNING: file /newcvs/Attic/Vectastar.bom doesn't match strip_path /newcvs/all/. ignoring
WARNING: file /newcvs/Attic/dMakefile doesn't match strip_path /newcvs/all/. ignoring
cvs rlog: Logging CVSROOT
WARNING: file /newcvs/CVSROOT/checkoutlist doesn't match strip_path /newcvs/all/. ignoring
WARNING: file /newcvs/CVSROOT/commitinfo doesn't match strip_path /newcvs/all/. ignoring
WARNING: file /newcvs/CVSROOT/config doesn't match strip_path /newcvs/all/. ignoring
WARNING: file /newcvs/CVSROOT/cvsignore doesn't match strip_path /newcvs/all/. ignoring

test.cvs is a fresh checkout of the whole tree. "newcvs" is the root of
CVS on the server. The warnings are the same when I try with "." as the
module. Or where you saying do this with the actually CVS repo itself?

> You might be able to do something similar with the CVSROOT/modules file,
> but I haven't tried.



> 
> -Peff
Alex, homepage: http://www.bennee.com/~alex/ There is no fool to the old
fool. -- John Heywood

```

## Alex Bennee, 2008-03-20 15:33

Subject: Re: Importing all modules in a CVS repo with git-cvsimport
Message-ID: <1206027215.24610.20.camel@pitcairn.cambridgebroadband.com>
URL: https://gitlist.dev/e/1206027215.24610.20.camel%40pitcairn.cambridgebroadband.com
In-Reply-To: <200803200646.08631.robin.rosenberg.lists@dewire.com>

```

On Thu, 2008-03-20 at 06:46 +0100, Robin Rosenberg wrote:
> Den Wednesday 19 March 2008 19.35.36 skrev du:
> > Hi,
> >
> > I'm wanting to import the entirety of a CVS repository into git rather
> > than an individual module. However every approach I've tried to do this
> > fails as the underlying cvsps tool seems to only be able to deal with
> > modules rather than the whole project.
> >
> > Is there any invocation I could do that would do the whole import?
> 
> You didnt' mention anything about you tried, but I recall that using ',' for 
> the module name is possible. Some version of CVS do not like it however
> and will bug out.
> 

I tried:

git-cvsimport -v  -C /export/csrc/import_test/test.git -d $CVSROOT .
git-cvsimport -v  -C /export/csrc/import_test/test.git -d $CVSROOT ,

as well as the suggested ln -s tricks and none worked. I've now got a
copy of the actual repo from the cvs server so I'll try and fake up a
"supermodule" to contain the tree.

Any pointers always appreciated :-)


> -- robin
Alex, homepage: http://www.bennee.com/~alex/ Art is anything you can get
away with. -- Marshall McLuhan.

```

## Jeff King, 2008-03-20 15:37

Subject: Re: Importing all modules in a CVS repo with git-cvsimport
Message-ID: <20080320153728.GA7798@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20080320153728.GA7798%40sigill.intra.peff.net
In-Reply-To: <1206007130.24610.6.camel@pitcairn.cambridgebroadband.com>

```
On Thu, Mar 20, 2008 at 09:58:50AM +0000, Alex Bennee wrote:

> WARNING: file /newcvs/CVSROOT/cvsignore doesn't match strip_path /newcvs/all/. ignoring
> 
> test.cvs is a fresh checkout of the whole tree. "newcvs" is the root of
> CVS on the server. The warnings are the same when I try with "." as the
> module. Or where you saying do this with the actually CVS repo itself?

Hmm. I tested and it worked fine on my system. I'm not sure what you
mean by "the CVS repo itself." I actually linked within the $CVSROOT
hierarchy. If your version of CVS isn't happy with the symlinks for some
reason, you could just munge your cvs hierarchy (assuming you are just
doing a one-shot import):

  cd /newcvs
  mkdir all
  for i in `ls | grep -v all | grep -v CVSROOT`; do
      mv $i all
  done

-Peff

```
