Subject: Re: [PATCH] cvsps/cvsimport: fix branch point calculation and broken branch imports

From: Junio C Hamano <[email-masked]>
Date: Wed, 02 Apr 2008 12:29:17 -0700

David Mansfield <[email-masked]> writes:

> In case you're wondering, I'm actually the original author of cvsps,
> which is behind the scenes for cvsimport.  I don't call myself
> maintainer because I've hardly been that over the last few years.
>
> Anyway, the fix to cvsps is attached (1st 2 patches) as well as the
> patch to git-cvsimport.perl (2nd 2 patches) against the master branch as
> of today's git repo.
>
> The cvsps patches apply with fuzz against the 2.1 version which is out
> there.

When output from an unfixed cvsps is fed to the updated cvsimport, does it
gracefully do the wrong thing (iow, create the same broken history not too
much worse than the original)?

> @@ -826,12 +824,9 @@ while (<CVS>) {
>  		$branch = $_;
>  		$state = 5;
>  	} elsif ($state == 5 and s/^Ancestor branch:\s+//) {
> -		s/\s+$//;
> -		$ancestor = $_;
> -		$ancestor = $opt_o if $ancestor eq "HEAD";
> +		# now ignored.  see 'Branches' below
>  		$state = 6;
>  	} elsif ($state == 5) {
> -		$ancestor = undef;
>  		$state = 6;
>  		redo;
>  	} elsif ($state == 6 and s/^Tag:\s+//) {