Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to convert a CVS project with many modules into one git repository?

I've inherited an old CVS project consisting of many modules. This split into modules is mainly historical, logically they belong together. I want to switch it to a GIT project. git cvsimport seems to be restricted to conversion of one module, but I do not want to use GIT submodules for the CVS modules - too much overhead.

I've looked into cvs2git briefly - it seems to work, but it creates many spurious commits for the tags (OK, some of the CVS tags do not cover the whole CVS source tree).

Another tool I've heard of is tailor - but I could not get it to work at all.

Any other recommendations?

like image 863
Wolfgang Liebich Avatar asked Dec 06 '25 02:12

Wolfgang Liebich


1 Answers

It looks like your best chance is to declare a root module in your CVSROOT/modules and reference all other modules under it:

#M  everything  Composite module which holds all other submodules
everything  &foo \
        &bar \
        &baz

– and then invoke git-cvsimport as usual:

git cvsimport -k -A authors everything -C my-git-repo

This approach doesn't always work for me, though (I'm getting the known error message WARNING: file foo doesn't match strip_path bar ignoring). Here's what Jeff King suggests:

As a hack, if you can move files in the CVS repository (and if you can't, try using cvssuck or similar to pull them locally, and then do the import from there), then move everything to a submodule "foo", and import that module.

Alternatively, you might check out some of the alternative importers like parsecvs or cvs2git. I don't know if they would handle this situation better.

And as a super-hacky alternative, you could import each module separately and then stich them all together using git-filter-branch.

Since git-cvsimport seems to be the only utility that supports author mapping, I suggest you move the files within your repository and then import a single module using git-cvsimport.

like image 133
Bass Avatar answered Dec 08 '25 16:12

Bass



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!