chiark / gitweb /
git-debrebase: rename gbp2gdr to convert-from-gbp
[dgit.git] / git-debrebase
index ad2672f1cd3e4f7633af0ee3b05874b6f06e80b5..acf4c8564749a9a812c4d17dca4749cdb80584b0 100755 (executable)
@@ -32,7 +32,7 @@
 #    git-debrebase [<options>] stitch [--prose=<for commit message>]
 #    git-debrebase [<options>] downstream-rebase-launder-v0  # experimental
 #
-#    git-debrebase [<options>] gbp2debrebase-v0 \
+#    git-debrebase [<options>] convert-from-gbp \
 #             <upstream>
 
 # problems / outstanding questions:
@@ -660,7 +660,6 @@ sub walk ($;$$) {
                $prline->(" Import");
                $rewrite_from_here->();
                $upp_limit //= $#upp_cl; # further, deeper, patches discarded
-                die 'BUG $upp_limit is not used anywhere?';
                $cur = $ovwr;
                next;
            } else {
@@ -702,6 +701,8 @@ sub walk ($;$$) {
        runcmd @git, qw(read-tree), $treeish;
        $read_tree_debian->($build);
     };
+
+    $#upp_cl = $upp_limit if defined $upp_limit;
  
     my $committer_authline = calculate_committer_authline();
 
@@ -737,7 +738,6 @@ sub walk ($;$$) {
                next;
            } elsif ($method eq 'DgitImportDebianUpdate') {
                $read_tree_debian->($cltree);
-               rm_subdir_cached qw(debian/patches);
            } elsif ($method eq 'DgitImportUpstreamUpdate') {
                confess unless $rewriting;
                my $differs = (get_differs $build, $cltree);
@@ -757,7 +757,7 @@ sub walk ($;$$) {
            my $newtree = cmdoutput @git, qw(write-tree);
            my $ch = $cl->{Hdr};
            $ch =~ s{^tree .*}{tree $newtree}m or confess "$ch ?";
-           $ch =~ s{^parent .*\n}{}m;
+           $ch =~ s{^parent .*\n}{}mg;
            $ch =~ s{(?=^author)}{
                join '', map { "parent $_\n" } @parents
            }me or confess "$ch ?";
@@ -1163,7 +1163,7 @@ END
     close U or failedcmd @upd_cmd;
 }
 
-sub cmd_gbp2debrebase () {
+sub cmd_convert_from_gbp () {
     badusage "needs 1 optional argument, the upstream" unless @ARGV<=1;
     my ($upstream_spec) = @ARGV;
     $upstream_spec //= 'refs/heads/upstream';
@@ -1210,9 +1210,9 @@ sub cmd_gbp2debrebase () {
        runcmd @git, qw(checkout -q gdr-internal~0);
        rm_subdir_cached 'debian/patches';
        $work = make_commit ['HEAD'], [
- 'git-debrebase import: drop patch queue',
+ 'git-debrebase convert-from-gbp: drop patch queue',
  'Delete debian/patches, as part of converting to git-debrebase format.',
- '[git-debrebase: gbp2debrebase, drop patches]'
+ '[git-debrebase convert-from-gbp: drop patches]'
                              ];
        # make the breakwater pseudomerge
        # the tree is already exactly right
@@ -1228,7 +1228,7 @@ sub cmd_gbp2debrebase () {
        $work = git_rev_parse 'HEAD';
     };
 
-    update_head_checkout $old_head, $work, 'gbp2debrebase';
+    update_head_checkout $old_head, $work, 'convert-from-gbp';
 }
 
 sub cmd_downstream_rebase_launder_v0 () {