CVS to GIT in Centos8

462 Views Asked by At

cvsimport is missing in Centos8. Unable to install. Now I tried to use fast-import. Most of the repos it is okay but it fails with some repo which has binary files. I think there is a bug in cvs-fast-export

$ cat ../repoexport.fi|git fast-import fatal: Unsupported command:
mark :11 fast-import: dumping crash report to
.git/fast_import_crash_19654 Unpacking objects: 100% (1/1), 21 bytes |21.00 KiB/s, done.

This is from the crash report

Most Recent Commands Before Crash
---------------------------------
  blob
  mark :1
  data 30790
  blob
  mark :2
  data 7060
  blob
  mark :3
  data 30650
  blob
  mark :4
  data 516323
  blob
  mark :5
  data 355588
  blob
  mark :6
  data 497407
  blob
  mark :7
  data 4397056
  blob
  mark :8
  data 807
  blob
  mark :9
  data 299008
  blob
  mark :10
  data 196608
  blob
  mark :11
* blob

Any solution to convert cvs to git?

2

There are 2 best solutions below

0
On BEST ANSWER

Posting solution based on comment exchange above in original question

I suggest trying cvs2git.

@RamananT says

I Tried and unfortunately cvs2git also failed with this error ERROR: The command 'cvs -Q -f -d :local:/home/user/path/to/cvs/repo/proj co -r1.1.1.2.1 -p -kb scripts/additions/320_str.20070501-001101.sql' failed with exit status=-9 and no output.

I then suggested

You could try that command yourself to see if the ,v file is somehow corrupted. The stored sql file it is a text file, but the .sq,v file is in RCS format and you would not be able to tell by inspection if it was corrupted or not. But you could fairly easily

  • run the cvs command that cvs2git says fails and see if it fails for you when run manually. Or
  • you could make a copy of the repo, remove that one file, and try cvs2git on that. That would also show you if that particular file is indeed a problem.

Thanks @mort, that made wonders. If it is an answer I would accept this solution. The issue is just on that file. I didn't investigate the issue but just deleted and carried on

0
On

Thanks to @Mort I am able to solve the issue and successfully import CVS in to GIT (BitBucket). To help anyone out there here is the exact steps. This worked on Centos 8.

  1. Copy the cvs repo that need to be migrated

    scp -r cvs_repo_server:/path/to/cvs/repo/project1 ./

  2. create CVSROOT to satisfy cvs2git tool

    mkdir project1/CVSROOT

  3. delete problematic files that fails. How you find out is running the cvs2git in further below steps. It is trial and error

    rm <project1/path/to/cvs/problematic/file,v>

  4. clone and run cvs2git

    git clone https://github.com/mhagger/cvs2svn.git

    cd cvs2svn

    ./cvs2git --blobfile=blob.dat --dumpfile=dump.dat --username=cvs2git --fallback-encoding utf-8 ../project1/

    cd ..

  5. create repo in bitbucket and then clone empty repo

    git clone bitbucket/url/mig_project1

  6. cd in to cloned repo

    cd mig_project1

  7. import into git and push it

    cat ../cvs2svn/blob.dat ../cvs2svn/dump.dat | git fast-import

    git push --all

    git push --tags