threads / discuss / 12748

Importing all modules in a CVS repo with git-cvsimport

Subject: Importing all modules in a CVS repo with git-cvsimport

## tl;dr

8 messages between Mar 19, 2008 and Mar 20, 2008.

replies: 7people: 4as markdown or json

Alex Bennee· Mar 19, 2008, 18:35 UTC · lore
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· Mar 19, 2008, 20:10 UTC · re: Alex Bennee · lore

Re: Importing all modules in a CVS repo with git-cvsimport

On Wed, 19 Mar 2008, Alex Bennee wrote:
Show 8 quoted lines
> 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*
Alex Bennee· Mar 20, 2008, 08:30 UTC · re: Daniel Barkalow · lore

Re: Importing all modules in a CVS repo with git-cvsimport

On 3/19/08, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 16 quoted lines
> 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
Jeff King· Mar 19, 2008, 20:41 UTC · re: Alex Bennee · lore

Re: Importing all modules in a CVS repo with git-cvsimport

On Wed, Mar 19, 2008 at 06:35:36PM +0000, Alex Bennee wrote:
Show 6 quoted lines
> 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
Alex Bennee· Mar 20, 2008, 09:58 UTC · re: Jeff King · lore

Re: Importing all modules in a CVS repo with git-cvsimport

On Wed, 2008-03-19 at 16:41 -0400, Jeff King wrote:
Show 25 quoted lines
> 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

Jeff King· Mar 20, 2008, 15:37 UTC · re: Alex Bennee · lore

Re: Importing all modules in a CVS repo with git-cvsimport

On Thu, Mar 20, 2008 at 09:58:50AM +0000, Alex Bennee wrote:
Show 5 quoted lines
> 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
Robin Rosenberg· Mar 20, 2008, 05:46 UTC · re: Alex Bennee · lore

Re: Importing all modules in a CVS repo with git-cvsimport

Den Wednesday 19 March 2008 19.35.36 skrev du:
Show 8 quoted lines
> 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· Mar 20, 2008, 15:33 UTC · re: Robin Rosenberg · lore

Re: Importing all modules in a CVS repo with git-cvsimport

On Thu, 2008-03-20 at 06:46 +0100, Robin Rosenberg wrote:
Show 14 quoted lines
> 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.

← back to recent threads