From 099608874f16c22a774ff9f427a8f172c84c66f9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 11 Aug 2018 12:25:20 +0100 Subject: [PATCH] git-debrebase: keycommits: Handle merged-breakwater commits Signed-off-by: Ian Jackson --- git-debrebase | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/git-debrebase b/git-debrebase index 8ddf18da..672551d5 100755 --- a/git-debrebase +++ b/git-debrebase @@ -810,6 +810,21 @@ sub classify ($) { return $classify->("VanillaMerge"); } +sub keycommits ($;$$$$$); + +sub mergedbreakwaters_anchor ($) { + my ($cl) = @_; + my $best_anchor; + foreach my $p (@{ $cl->{Parents} }) { + my ($panchor, $pbw) = keycommits $p->{CommitId}, + undef,undef,undef,undef, 1; + $best_anchor = $panchor + if !defined $best_anchor + or is_fast_fwd $best_anchor, $panchor; + } + return $best_anchor; +} + sub keycommits ($;$$$$$) { my ($head, $furniture, $unclean, $trouble, $fatal, $claimed_bw) = @_; # => ($anchor, $breakwater) @@ -901,6 +916,8 @@ sub keycommits ($;$$$$$) { $x->($trouble, 'vanillamerge', "found vanilla merge"," ($head)"); return (undef,undef); + } elsif ($ty eq 'MergedBreakwaters') { + $found_anchor->(mergedbreakwaters_anchor $cl); } else { $x->($fatal, 'unprocessable', "found unprocessable commit, cannot cope: $cl->{Why}", -- 2.30.2