Subject: Re: [PATCH, 2nd version] git-archimport: allow remapping branch names

From: Paolo Bonzini <[email-masked]>
Date: Wed, 07 Mar 2007 10:06:56 +0100

> Just to make sure.  Was it tested with AND WITHOUT the new colon
> feature?  I am asking how likely is there a regression.

Yes.  But my Arch repositories do not have colons in the name (I mean I tested on real-world repositories and not weird ones created exactly to make the patch fail).

>> -my %arch_branches = map { $_ => 1 } @ARGV;
>> +my %arch_branches = map { my $branch = $_; $branch =~ s/:.*//; $branch => 1 } @ARGV;

In fact, I was too headlong on your suggestion.  I should have noticed that this substitution must be changed to

$branch =~ s/:[^:]*$//

I just realized, however, that branches with colons in the names would have failed before my patch too, because git would have failed creating a branch with a colon in it.  So this is not a regression, strictly speaking.

> Strictly speaking (-e "$git_dir/refs/heads/$branch") test would
> not work if the repository was pack-ref'ed with --all option.
> Run "git show-ref -q --verify refs/heads/$branch" and check its
> exit status, or run it without -q and read its output.

Unfortunately this is pervasive in git-archimport.  I can fix it, but I think it belongs in a separate patch.

> With the original code, a tag "t--a/g" was mapped to "t--a,g" in
> the else clause, but the new code yields git_branchname("t--a/g")
> followed by '--' followed by "g", which would evaluate to I do
> not know what exactly, but I am sure it would not evaluate to
> "t--a,g".  Would it be a non-issue?  As archimport seems to support
> incremental import, I suspect it might upset existing users.

In this case, this input will always be of the form t--a/g--REVISION.

So the old one would change to t--a,g--REVISION; the new one would
strip to t--a/g and convert it to t--a,g (using git_default_branchname)
and file tack --REVISION at the end again.

I will shortly send an updated patch

Paolo