A Very Subtle Git-CVSImport Bug, and Its Workaround
I’ve been trying to follow Mikkel Hoegh’s handy instructions to mirror some of the Drupal CVS repositories onto github, so that git users like myself can make better use of our favorite tool. But I hit a snag last month when I found a bug in my Drupal git mirror. A commit from last December had failed to go through, breaking all the Drupal 7 commits since then.
I’ve spent some time off and on trying to figure out what went wrong, since a mirror with occasional errors and omissions isn’t very useful. Just today I found a very handy post on Stack Overflow that appears to have solved my problem.
I had tried using Mikkel’s command to mirror a CVS repository with git:
git-cvsimport -v -d:pserver:anonymous@cvs.drupal.org:/cvs/drupal -o upstream drupal
Which (oddly) seems to work for him — his own Drupal mirror on github works just fine. It didn’t work for me, though. Neither did this:
git cvsimport -p x -v -k -o cvshead -s _ -d :pserver:anonymous@cvs.drupal.org:/cvs/drupal -C drupal drupal
But it turns out that the -p x flag, which means “pass the -x flag through to cvsps”, isn’t correct. You have to say -p -x, like this:
git cvsimport -p -x -v -k -o cvshead -s _ -d :pserver:anonymous@cvs.drupal.org:/cvs/drupal -C drupal drupal
One tiny dash makes the difference. My new mirror appears to be correct. I’m glad someone else found this workaround, since I would probably have never found it myself.
Having said that, I’m actually going to take down my own Drupal mirror on github and recommend that everyone use Mikkel’s instead. It’s correct and, so long as he is maintaining it, it makes no sense to waste resources maintaining it twice. What I’m going to do is put up some mirrors of common Drupal modules to go along with it.
Comments
Post new comment