git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Martin Langhoff <martin@catalyst.net.nz>
Cc: git list <git@vger.kernel.org>
Subject: [PATCH 1/2] archimport: allow for old style branch and public tag names
Date: Tue, 15 Nov 2005 00:05:46 -0800	[thread overview]
Message-ID: <20051115080546.GA30506@Muzzle> (raw)
In-Reply-To: <20051115080352.GG7484@mail.yhbt.net>

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.

Signed-off-by:: Eric Wong <normalperson@yhbt.net>

---

 git-archimport.perl |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

applies-to: 44d831812786f4dfbf54a67b51e5f48c7d5afd66
4b341dd903883db0a89fe2f04e93dab053beb045
diff --git a/git-archimport.perl b/git-archimport.perl
index 1f721f6..304d462 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -67,12 +67,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_t,$opt_D,$opt_a);
+our($opt_h,$opt_v,$opt_T,$opt_t,$opt_D,$opt_a,$opt_o);
 
 sub usage() {
     print STDERR <<END;
 Usage: ${\basename $0}     # fetch/update GIT from Arch
-       [ -h ] [ -v ] [ -T ] [ -a ] [ -D depth  ] [ -t tempdir ]
+       [ -o ] [ -h ] [ -v ] [ -T ] [ -a ] [ -D depth  ] [ -t tempdir ]
        repository/arch-branch [ repository/arch-branch] ...
 END
     exit(1);
@@ -267,7 +267,15 @@ sub tree_dirname {
     return $name;
 }
 
-*git_branchname = *tree_dirname;
+# old versions of git-archimport just use the <category--branch> 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 in ancestry order
 foreach my $ps (@psets) {
@@ -527,8 +535,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")
---
0.99.9.GIT

  reply	other threads:[~2005-11-15  8:05 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-12  9:23 [PATCH] archimport improvements Eric Wong
2005-11-12  9:25 ` [PATCH 1/5] remove shellquote usage for tags Eric Wong
2005-11-12  9:27   ` [PATCH 2/5] archimport: don't die on merge-base failure Eric Wong
2005-11-12  9:29     ` [PATCH 3/5] Disambiguate the term 'branch' in Arch vs git Eric Wong
2005-11-12  9:30       ` [PATCH 4/5] Overhaul of changeset application Eric Wong
2005-11-12  9:32         ` [PATCH 5/5] -D <depth> option to recurse into merged branches Eric Wong
2005-11-14  2:01           ` Eric Wong
2005-11-12 12:07         ` [PATCH 4/5] Overhaul of changeset application Martin Langhoff
2005-11-12 20:49           ` Eric Wong
2005-11-12 11:54 ` [PATCH] archimport improvements Martin Langhoff
2005-11-12 20:21   ` Eric Wong
2005-11-14 22:38     ` Martin Langhoff
2005-11-15  8:03       ` Eric Wong
2005-11-15  8:05         ` Eric Wong [this message]
2005-11-15  8:06           ` [PATCH 2/2] archimport: sync_to_ps() messages for tracking tla methods Eric Wong
2005-11-15  8:07           ` [PATCH 1/2] archimport: allow for old style branch and public tag names Eric Wong
2005-11-17  9:26 ` [PATCH] archimport improvements Martin Langhoff
2005-11-24  7:46   ` Eric Wong
2005-11-24  7:47     ` [PATCH 1/9] archimport: first, make sure it still compiles Eric Wong
2005-11-24  7:48       ` [PATCH 2/9] remove String::ShellQuote dependency Eric Wong
2005-11-24  7:50         ` [PATCH 3/9] fix -t tmpdir switch Eric Wong
2005-11-24  7:51           ` [PATCH 4/9] remove git wrapper dependency Eric Wong
2005-11-24  7:52             ` [PATCH 5/9] add -D <depth> and -a switch Eric Wong
2005-11-24  7:53               ` [PATCH 6/9] safer log file parsing Eric Wong
2005-11-24  7:55                 ` [PATCH 7/9] Add the accurate changeset applyer Eric Wong
2005-11-24  7:56                   ` [PATCH 8/9] Fix a bug I introduced in the new log parser Eric Wong
2005-11-24  7:58                     ` [PATCH 9/9] fix a in new changeset applyer addition Eric Wong
2005-11-27  4:24                   ` [PATCH 7/9] Add the accurate changeset applyer Martin Langhoff
2005-11-27  5:43                     ` Eric Wong
2005-12-01 17:02                   ` Martin Langhoff
2005-12-03  2:51                     ` Eric Wong
2005-12-05 18:53                       ` Martin Langhoff
2005-11-24  8:20             ` [PATCH 4/9] remove git wrapper dependency Andreas Ericsson
2005-11-24  8:35               ` Junio C Hamano
2005-11-24  8:50                 ` Eric Wong
2005-11-24 18:54       ` [PATCH 1/9] archimport: first, make sure it still compiles Linus Torvalds
2005-11-26 10:51         ` Martin Langhoff
2005-11-26 20:43         ` Eric Wong
2005-11-24  9:25     ` [PATCH] archimport improvements Martin Langhoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051115080546.GA30506@Muzzle \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=martin@catalyst.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).