Someone recommended cvs2git to do this, but I couldn't get the tool to do what I wanted simply and I gave up after half an hour, switching to using git-cvsimport instead. The latter is part of the git core binaries and a lot easier to use in my case.
1. Get a local copy of the CVS repository:
While it is possible to use git-cvsimport to perform the conversion over the network, this is terribly slow. It is much more efficient to retrieve a copy of your CVS repository onto your local machine, and perform the conversion there. It will literally save your hours.
Fortunately, the FreeType sources are located on Savannah servers, whose admins are smart, so getting this local copy through rsync is trivial:
mkdir /tmp/prepAfter less than 2 minutes, a complete copy of the full CVS repository is on my /tmp/prep/freetype directory.
cd /tmp/prep
rsync -avz rsync://cvs.sv.gnu.org/sources/freetype .
2. Adjust your copy's configuration:
Depending on the way your CVS repository was managed on the original server, you may need to change your copy's CVSROOT/config file. For example, mine had the following lines:
# Put CVS lock files in this directory rather than directly in the repository.Here, the LockDir pointed to a Savannah-specific lock directory that didn't exist on my machine. This caused a weird error message later when calling git-cvsimport. It took me a few tries to guess that this was the problem, and I simply commented the LockDir line to solve it.
LockDir=/var/lock/cvs/sources/freetype
Your own configuration might be more complex. Have a look at it first, and in doubt, simply comment any suspicious line with a weird path in it.
3. Convert your modules into git repositories:
With FreeType, each CVS module has its own ChangeLog and history, so it's only logical to convert each one of them into a different git repository. For example, to convert the "ft2demos" CVS module into a git repository called "freetype2-demos.git", one can do:
export CVSROOT=/tmp/prep/freetypeNote the options used here:
git-cvsimport -v -i -a -C /tmp/prep/freetype2-demos.git ft2demos
-v => enable version operationsNote that in theory, you could use the option "-d /tmp/prep/freetype" to specify the CVS root directly;however for some reason this caused errors in cvsps, the tool program invoked by git-cvsimport. So try to define the CVSROOT in your environment instead.
-i => import only (we don't want to create an index and working sources at the destination)
-a => import everything (instead of the default less-than-10-minutes-old commits)
-C <path>=> specify target git directory
After a few minutes, you'll get a shiny git repository in /tmp/prep/freetype2-demos.git/.git
I also did it for two other modules:
git-cvsimport -v -i -a -C /tmp/prep/freetype2.git freetype2
git-cvsimport -v -i -a -C /tmp/prep/ftjam.git jam
Next episode, how to setup the server and copy our fresh git repositories to it...