From fee3365fe13f36fdd432b1ede9980062cf744663 Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Thu, 17 Nov 2005 21:20:45 +1300 Subject: [PATCH] archimport: allow for old style branch and public tag names This patch adds the -o switch, which lets old trees tracked by git-archmirror continue working with their old branch and tag names to make life easier for people tracking your tree. Private tags that are only used internally by git-archimport continue to be new-style, and automatically converted upon first run. [ ml: rebased to skip import overhaul ] Signed-off-by:: Eric Wong Signed-off-by: Martin Langhoff --- git-archimport.perl | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/git-archimport.perl b/git-archimport.perl index 47174391a..c3bed0808 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -72,13 +72,12 @@ my $git_dir = $ENV{"GIT_DIR"} || ".git"; $ENV{"GIT_DIR"} = $git_dir; my $ptag_dir = "$git_dir/archimport/tags"; -our($opt_h,$opt_v, $opt_T, - $opt_C,$opt_t); +our($opt_h,$opt_v, $opt_T,$opt_t,$opt_o); sub usage() { print STDERR < part: +sub old_style_branchname { + my $id = shift; + my $ret = safe_pipe_capture($TLA,'parse-package-name','-p',$id); + chomp $ret; + return $ret; +} + +*git_branchname = $opt_o ? *old_style_branchname : *tree_dirname; # process patchsets foreach my $ps (@psets) { @@ -629,8 +636,12 @@ sub parselog { sub tag { my ($tag, $commit) = @_; - # don't use subdirs for tags yet, it could screw up other porcelains - $tag =~ s|/|,|; + if ($opt_o) { + $tag =~ s|/|--|g; + } else { + # don't use subdirs for tags yet, it could screw up other porcelains + $tag =~ s|/|,|g; + } if ($commit) { open(C,">","$git_dir/refs/tags/$tag") -- 2.30.2