chiark / gitweb /
git-debrebase: merge: Avoid asking user to re-merge debian/
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 12:47:59 +0000 (13:47 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 14:36:23 +0000 (15:36 +0100)
If it had conflicts, they will have been resolved earlier and we can
just take that resolution.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 6d51a90..9c44419 100755 (executable)
@@ -395,10 +395,8 @@ sub merge_series ($$;@) {
        foreach my $q ($base_q, reverse @input_qs) {
            my $s = $q->{MR}{S};
            gbp_pq_export "p-$s", $q->{SeriesBase}, $q->{SeriesTip};
-           # xxx avoid trying to merge debian/ again here, by
-           # always using debian/ from newbase
+           my @earlier;
            if (open S, $seriesfile) {
-               my @earlier;
                while (my $patch = <S>) {
                    chomp $patch or die $!;
                    $prereq{$patch} //= {};
@@ -426,6 +424,20 @@ sub merge_series ($$;@) {
                 "[git-debrebase merge-innards patch-queue prep:".
                 " $q->{SeriesTip}]"
             ];
+
+           read_tree_debian $newbase;
+           if (@earlier) {
+               read_tree_subdir 'debian/patches', "$pec:debian/patches";
+           } else {
+               rm_subdir_cached 'debian/patches';
+           }
+           $pec = make_commit [ $pec ], [
+ "Update debian/ (excluding patches) to final to avoid re-merging",
+ "debian/ was already merged and we need to just take that.",
+                "[git-debrebase merge-innards patch-queue packaging:".
+                " $q->{SeriesTip}]"
+            ];
+
            printdebug "pec' $pec\n";
             runcmd @git, qw(reset -q --hard), $pec;
            $q->{MR}{PEC} = $pec;