Converting Fedora CVS to Git

So far on this trip, i've managed to spend most of my time hanging around the Netherlands with that easy laziness that Dutch hackers seem to have. I can never stress how nice of the place the Netherlands is to visit. It's too bad that there's no English word for 'gezelligheid'. Even the spell checker's first recommendation for that is 'intelligentsia' which is very much not the same thing.

In spite of gezelligheid, (or perhaps because of it), i've managed to get a working CVS to git converter working. This is not a generic general purpose converter, because hey, there are many available, and i'm even using one. The goal of this converter is to go from Fedora CVS to Git and vica versa. There are a number of advantages to this. For starters, it makes it much easier to view the history of the RPM, but there are many other advantages too. Here are some other advantages:

Take me to the Code! Enough of the techno-babble!

Still here...? Good.

  • Forking new branches could be theoretically easier, to test out new features, and perhaps branch for Fedora N and Fedora N+1
  • Cherry picking patches from one Fedora Release branch into another
  • Rebasing changes from test branches to Fedora releases
  • Git is far better than CVS


Also, another reason for doing it this way is that the git tree that the developer makes is inherently local to his or her system. This does not require everyone to migrate their projects over. It's also not meant to be a final answer on how to convert. There has been alot of talk about newer, fancier, and shinier ways to implement RPM building from upstream source packages. Since this is in Fedora Devshell, the goal is to accomodate multiple ideas as testing grounds to see which one works.

In any case, here is how it works. I will post directions below if you want to try it out. Rather than using some complicated trickery to turn one CVS tree (namely /rpms/) into a git repo, i turn each branch into a git repo instead. I begin with /rpms//devel, and create a linear history out of that. Then i create more linear histories for each branch. Finally, from the devel branch, i fetch the other branches into it. Last but not least, i save a copy of the original CVS checkout, because there are some operations that are best done from CVS itself. Fortunately for the developer, this is all automated.

I have a list of features that i've been talking to kanarip about adding to this, that will probably show up in the not too far future. Meanwhile, this code needs testing. The Fedora CVS is full of hacks and workarounds from over the years. Let's see how much of this actually works. If you're interested in using this at all for your RPM development, grab a copy, fire it up, and let me know what breaks and what works. The best thing to do is use the following test plan. (I'll copy this to the wiki too.)

  1. Pull the latest git tree from the master branch
  2. Set up your running environment
  3. Pull from the Fedora CVS as an anonymous user and make it .trial.1
  4. Pull again but with your login credentials, and make it .trial.2
  5. Use your favorite git history browser and verify that things look ok.
  6. Make sure that there are no discrepencies between the two trials.


Finally, use the trac instance setup to send in bug reports. I'll be trying to keep up on them, Fosdem schedule permitting.

Instructions: https://fedoraproject.org/wiki/CVS_and_Devshell
Trac: https://fedorahosted.org/fedora-devshell/report

0 flames: