git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Paolo Bonzini <paolo.bonzini@lu.unisi.ch>
Date
Mar 7, 2007, 09:06 UTC
Message-ID
<45EE80B0.8010403@lu.unisi.ch>
In-Reply-To
<7vlki9h1mg.fsf@assigned-by-dhcp.cox.net>
> 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.
Show 6 quoted lines
> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 9 in “git-archimport: allow remapping branch names”
  1. git-archimport: allow remapping branch namesPaolo Bonzini, Mar 7, 2007
  2. Junio C HamanoMar 7, 2007
  3. git-archimport: allow remapping branch namesPaolo Bonzini, Mar 7, 2007
  4. Junio C HamanoMar 7, 2007
  5. Paolo BonziniMar 7, 2007
  6. Junio C HamanoMar 7, 2007
  7. Paolo BonziniMar 7, 2007
  8. Paolo BonziniMar 7, 2007
  9. Paolo BonziniMar 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.