chiark / gitweb /
git-debrebase: merge: Avoid needlessly walking MergedBreakwaters
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 14:36:54 +0000 (15:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 14:36:54 +0000 (15:36 +0100)
We will not ever need to rewrite one of these, so we can just ask
keycommits for its anchor.

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

index 9c44419..35b75cd 100755 (executable)
@@ -1130,7 +1130,11 @@ sub walk ($;$$$) {
                return $bomb->();
            }
            die "$ty ?";
-       } elsif ($ty eq 'VanillaMerge' or $ty eq 'MergedBreakwaters') {
+       } elsif ($ty eq 'MergedBreakwaters') {
+           $last_anchor = mergedbreakwaters_anchor $cl;
+           $build_start->(' MergedBreakwaters', $cur);
+           last;
+       } elsif ($ty eq 'VanillaMerge') {
            # User may have merged unstitched branch(es).  We will
            # have now lost what ffq-prev was then (since the later
            # pseudomerge may introduce further changes).  The effect
@@ -1166,9 +1170,6 @@ sub walk ($;$$$) {
 
            printdebug "*** MERGE\n";
 
-           # xxx avoid calling walk without nogenerate when
-           # we have a MergedBreakwater; instead call keycommits ?
-
            my @bwbcmd = (@git, qw(merge-base));
            my @ibcmd = (@git, qw(merge-base --all));
            my $might_be_in_bw = 1;