Subject: cvsimport bug on branches [was: conversion to git]

From: Eric Blake <[email-masked]>
Date: Thu, 20 Sep 2007 19:17:47 -0600

According to Eric Blake on 9/19/2007 5:13 PM:
> I'm working on converting M4 to git.
> 
> The initial git conversion is complete.  Feel free to check it out:
> 
> http://git.savannah.gnu.org/gitweb/?p=m4.git

Unfortunately, after publishing this repository, I noticed that there is a
bug in git-cvsimport, when a vendor branch is created that contains fewer
files than the point it branched from.  Those files were not removed from
the commit on the new branch, which means the git repository contains too
many files compared to what the CVS repository had for any checkout along
the branch.

For example, look at the m4-1.4.1 tag.  In CVS,

http://cvs.savannah.gnu.org/viewvc/m4/?root=m4&hideattic=0&pathrev=m4-1_4_1

shows the following:
ABOUT-NLS (dead) 	No revisions exist on m4-1_4_1

and for the file ChangeLog, the predecessor of m4-1_4_1 (rev 1.1.1.1.2.1)
was m4-1_4 (rev 1.1.1.1):

http://cvs.savannah.gnu.org/viewvc/m4/ChangeLog?hideattic=0&view=log&root=m4&pathrev=m4-1_4_1

But after git-cvsimport (using git 1.5.3), tag m4-1.4.1 is shown on the
branch-1_4 branch, but with unrelated m4-1.4ppre2 as parent, instead of
the correct m4-1.4:

http://git.sv.gnu.org/gitweb/?p=m4.git;a=shortlog;h=ab2ce6be

and as a result, the tree includes ABOUT-NLS (which was correctly a part
of the m4-1.4ppre2 tag on the master branch):

http://git.sv.gnu.org/gitweb/?p=m4.git;a=tree;h=ab2ce6bec48;hb=ab2ce6bec4

Now that the repository is published, what's the best way to correct the
history for the git m4-1.4.1 tag, to correctly pick the m4-1.4 commit as
its parent, and to omit the files that were intentionally omitted from the
CVS branch it was imported from?

What needs to be done to git-cvsimport to make it recognize files that
were omitted from CVS branch creation points, to avoid this problem in the
first place?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [email-masked]