git cvsimport Error: “root … must be an absolute p

2020-05-08 08:12发布

问题:

I'm trying to clone a CVS repository using git:

lawsa~/java/projects/iu$ git cvsimport -C ../iugit ebs/fs/kfs
Expected Valid-requests from server, but got: E Root
:extssh:lawsa@cvs.uits.iu.edu:/srcctrl/CVS must be an absolute pathname
lawsa~/java/projects/iu$ 

I see that another man had a similar problem here. He cites his solution: "As long as I use anonymous access then I can get the convert working!". This doesn't work as our server will certainly not allow anonymous access (even if they did for reads, I need read/write access).

I'm following the instructions from gitcvs-migration which says:

...cd to a checked out CVS working directory of the project you are interested in
and run git-cvsimport(1):

     $ git cvsimport -C <destination> <module>

I have followed these instructions (and have cvsps version 2.1) by navigating to a local working copy. It's obvious that git cvsimport is finding my CVS_ROOT from the CVS directory in my working copy because I didn't specify it, but it's showing up in the error message.

Please let me know if you can help. Remember, something small could be something big! :-)

回答1:

I finally had some success with the git cvs command. It seems that you can import your directory without specifying :extssh in your cvs root. Simply go to a new directory and enter:

git cvsimport -v -d user@server:/path/to/dir -r cvs -k my_module

This solved the "must be an absolute pathname" error.



回答2:

I'm very happy to have figured it out:

lawsa~/java/projects$ git cvsimport -d "$CVSROOT" -C iugit -r cvs -k ebs/fs/kfs
Expected Valid-requests from server, but got: E Root     
:extssh:lawsa@cvs.uits.iu.edu:/srcctrl/CVS must be an absolute pathname
lawsa~/java/projects$ echo $CVSROOT
:extssh:lawsa@cvs.uits.iu.edu:/srcctrl/CVS
lawsa~/java/projects$ CVSROOT=:ssh:lawsa@cvs.uits.iu.edu:/srcctrl/CVS
lawsa~/java/projects$ git cvsimport -d "$CVSROOT" -C iugit -r cvs -k ebs/fs/kfs
Expected Valid-requests from server, but got: E Root 
:ssh:lawsa@cvs.uits.iu.edu:/srcctrl/CVS must be an absolute pathname
lawsa~/java/projects$ CVSROOT=:ext:lawsa@cvs.uits.iu.edu:/srcctrl/CVS                                     
lawsa~/java/projects$ git cvsimport -d "$CVSROOT" -C iugit -v -r cvs -k ebs/fs/kfs                                                                                                                                   
Password: 
Could not chdir to home directory /home/lawsa: No such file or directory
fatal: Needed a single revision
Branch 'master' does not exist.
Either use the correct '-o branch' option,
or import to a new repository.
lawsa~/java/projects$ rm iugit -r
lawsa~/java/projects$ git cvsimport -d "$CVSROOT" -C iugit -v -r cvs -k ebs/fs/kfs
Password: 
Could not chdir to home directory /home/lawsa: No such file or directory
Initialized empty Git repository in /home/lawsa/java/projects/iugit/.git/
Running cvsps...
Password: 
Could not chdir to home directory /home/lawsa: No such file or directory
cvs_direct initialized to CVSROOT /srcctrl/CVS
cvs rlog: Logging ebs/fs/kfs
cvs rlog: Logging ebs/fs/kfs/.settings
cvs rlog: Logging ebs/fs/kfs/batch
cvs rlog: Logging ebs/fs/kfs/batch/.securedir

Perhaps git cvsimport doesn't accept extssh as an authentication mechanism ?