4

In order to import a revision of a CVS module, I am using:

/usr/lib/git-core/git-cvsimport -a -i -p r,revisionname -k -v -d :pserver:user@xxx.com:2401/srv/cvs/rootname modulename

It works for a while and then I get something like cvsps got an error. How do I determine what the cvsps error is?

kenorb
  • 155,785
  • 88
  • 678
  • 743
reza
  • 5,972
  • 15
  • 84
  • 126
  • I get a very large number of warnings on the ... does not match strip_path and at the end I get "git cvsimport: fatal: cvsps reported error" – reza Mar 07 '12 at 22:16
  • found a -v flag for cvsps and now I get cvs_direct: cvs_direct: rlog: read M state: 0 read line: cvs_direct: rlog: read M 1) user: Removed serial(s) hugggggggggggggggggggggggggggggge line of characters git cvsimport: fatal: cvsps reported errorgit cvsimport: fatal: cvsps reported error – reza Mar 07 '12 at 22:55
  • I gave up on this approach, many people are recommending not using git-cvsimport. So now I am using cvs2git. I have success with tiny projects. When I try the real thing, I run into a different issue. cvs2git --username=reza -v --blobfile=./blob.txt --dumpfile=./dump.txt ./localCVSTree/repo I see the blob file get created and not the dump file. What does that mean? An error? – reza Mar 12 '12 at 14:45
  • Hi reza, Can you explain in detail how cvs2git did the trick? Append that to your answer, please. – Jatin Ganhotra Jul 15 '12 at 12:01
  • the problem with svn2git was the fact that I kept getting an error that I did not understand or could find any help/workaround for. I was lucky that we had a slightly out of date version of the code in CVS. Using the cvs2git, I did not see the error and was able to import the code to git. My solution is only helpful if CVS is an option. If not, I would try the svn2git, may be you will have success. – reza Jul 16 '12 at 15:33
  • possible duplicate of [What is the best way to import a CVS repository in GIT and use it locally?](http://stackoverflow.com/questions/11362676/what-is-the-best-way-to-import-a-cvs-repository-in-git-and-use-it-locally) – kenorb Mar 17 '15 at 23:47

4 Answers4

3

Gave up on this approach and have used cvs2git.

The cvs2git is a tool that can be used to migrate CVS repositories to newer version control tools, including git.

Sample usage:

cvs2git \
    --blobfile=cvs2git-tmp/git-blob.dat \
    --dumpfile=cvs2git-tmp/git-dump.dat \
    --username=cvs2git \
    /path/to/cvs/repo
kenorb
  • 155,785
  • 88
  • 678
  • 743
reza
  • 5,972
  • 15
  • 84
  • 126
2

From http://git-scm.com/docs/git-cvsimport

WARNING: git cvsimport uses cvsps version 2, which is considered deprecated; it does not work with cvsps version 3 and later. If you are performing a one-shot import of a CVS repository consider using cvs2git or parsecvs.

Check if you have a cvsps version 3 or later

$ cvsps --version

If you can downgrade it to cvsps version 2 you are done.

Main difference is cvs2git is not incremental (except using this workaround), so it's targeted to one-shot checkout. With cvsimport you can do incremental updates, and stay up to date to cvs repo.

albfan
  • 12,542
  • 4
  • 61
  • 80
2

You may downgrade it to cvsps-2.1 and re-test, as git cvsimport doesn't work properly with cvsps-3.x, because it has different syntax.

On OSX you can (having brew):

brew tap homebrew/versions
brew install cvsps2
brew unlink cvsps
brew link --overwrite cvsps2
kenorb
  • 155,785
  • 88
  • 678
  • 743
  • 1
    The cobite site seems to have dropped their cvsps page (and who can blame them). The files are happily in the Wayback Machine. You can `brew edit cvsps2` and set the url to `http://web.archive.org/web/20160127055537/http://www.cobite.com/cvsps/cvsps-2.1.tar.gz` – Mark Feb 09 '16 at 12:32
  • 2
    FWIW I created a formula to install cvsps2: https://github.com/Frizlab/homebrew-Perso/blob/master/Formula/cvsps%402.rb – Frizlab May 27 '17 at 07:39
2

Try cvs-fast-export first:

http://www.catb.org/esr/cvs-fast-export/

It will fail cleanly in some weird cases. If that happens, try cvs2git. You don't want to go with cvs2git first, as it is extremely slow, generates results in an inconvenient format, doesn't convert cvsignore files, and has several other minor problems as well.

Don't use git-cvsimport or either version of cvsps - they suck pretty badly, and will probably misplace your branch joins. I was the person responsible for the cvsps-3.x releases; I deep-sixed that code in favor of what became cvs-fast-export.

ESR
  • 574
  • 1
  • 5
  • 10