Importing revision history from CVS to Git
Published: Thursday 2007-09-13.
I have been using CVS to do revision control in several of my projects for quite some time, for instance this blog, and the web site it is part of, is revision controlled by CVS. One of the major problems of CVS is that it is centralised, which means that new users that are to be participate need to be allowed access, and also it means that you always need to have network access to be able to do anything useful. That is why I recently have become interested in distributed revision control systems.
My first attempts was as a translator for Dpkg when the then lead developer switched over to version control Dpkg with Arch. I never really learnt enough of Arch, and never really got an overview of how it worked, so the translation was left dangling for a while. Dpkg have now switched to using Git, which I have tried to learn quite a bit more. (Another project I am translating, Apt, is using Bazaar, a descendant of Arch that I haven’t had time to learn more about yet, either).
Since I found git to have a good structure I decided to try to move parts of my own projects to the system. I started with my Turquoise project, a statistics gathering tool for Fidonet and Usenet, which unfortunately has not been under very active development lately. Following the model of Dpkg, I decided to make sure I brought over the entire development history for the project. I first tried it with Git’s own git-cvsimport and Tailor, but none of them were able to import more than the CVS main branch, and I had several branches of side-development that I would like to keep.
To my rescue came
that was able to import everything.
The drawback with Parsecvs is that you have to have access to the physical
CVS repository to run it, since it does interpret the files in the
It does, however, do it well, unless you have done something very magical
The result is that my project now has a
on Alioth and that I have tried to activate it a bit more, at least I am
planning to try and finish off the template handling that I started on
at one time five years ago.
My only unsolved problem at the moment is to try and figure out if it is possible to modify the revision tree so that the merges I have performed in CVS can show up as Git merges (i.e insert an extra parent node for those versions).
Footnote: To convert the CVS repository to Git I performed the following steps:
Created the file
Authorsthat contained a mapping table for CVS users. In my case only the line
peter=Peter Karlsson <email@example.com>
From a directory with the
Authorsfile and the CVS repository in it, ran
find turqstat -name "*,v" | parsecvs
.gitdirectory over to Alioth.
Moved the definition of the imported branches from