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

Re: [PATCH] git-archimport: allow remapping branch names

From
Junio C Hamano <junkio@cox.net>
Date
Mar 7, 2007, 08:09 UTC
Message-ID
<7vodn5iiew.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<eslrcr$9rc$1@sea.gmane.org>
Paolo Bonzini <bonzini@gnu.org> writes:
Show 6 quoted lines
> The new command-line syntax should not be a problem, since a colon
> in a branch name would be a pretty weird choice even for
> Arch standards.
>
> The new feature is implemented so that archives rotated every
> year can be remapped into a single git archive.
Show 10 quoted lines
>  'git-archimport' [-h] [-v] [-o] [-a] [-f] [-T] [-D depth] [-t tempdir]
> -               <archive/branch> [ <archive/branch> ]
> +               <archive/branch>[:<git-branch>] ...
> ...
> -my %arch_branches = map { $_ => 1 } @ARGV;
> +my %arch_branches = map { my $branch = $_; $branch =~ s/:.*//; $branch => 1 } @ARGV;
> +
> +# $branch_name_map:
> +# maps arch branches to git branch names
> +my %branch_name_map = map { m/^([^:]*):(.*)/; $1 => $2 } grep { m/:/ } @ARGV;

I am no arch/tla expert, but at least git does not allow colon in branch names at all, so if you make your command line parser to match left-greedy-anything, colon and then right-non-colon (i.e. m/^(.*):([^:]*)$/), you should be able to handle colons in arch archive names.

Previous: Paolo BonziniNext: Paolo Bonzini
Message 2 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.