summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 22ff00f)
raw | patch | inline | side by side (parent: 22ff00f)
author | Martin Langhoff <martin@catalyst.net.nz> | |
Thu, 17 Nov 2005 08:20:45 +0000 (21:20 +1300) | ||
committer | Martin Langhoff <martin@catalyst.net.nz> | |
Thu, 17 Nov 2005 08:20:45 +0000 (21:20 +1300) |
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 <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
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 <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
git-archimport.perl | patch | blob | history |
diff --git a/git-archimport.perl b/git-archimport.perl
index 47174391a7407b1531971619dcbf8c62f6fcb4f1..c3bed08086d69fe3cc79b64117193a9173faa91f 100755 (executable)
--- a/git-archimport.perl
+++ b/git-archimport.perl
$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 <<END;
Usage: ${\basename $0} # fetch/update GIT from Arch
- [ -h ] [ -v ] [ -T ] [ -t tempdir ]
+ [ -o ] [ -h ] [ -v ] [ -T ] [ -t tempdir ]
repository/arch-branch [ repository/arch-branch] ...
END
exit(1);
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
foreach my $ps (@psets) {
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")