X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=git-debrebase;h=2b257dd6bfea76d923a1e3da918f10c4d911ac1d;hp=f72625d6166a156322b2860671e5a7bd6c1c8d87;hb=e8ab02477159b5bd91a3566dc28367ed4a910b3a;hpb=499215e8030c9966577574a6ada7ef0f03df8db7 diff --git a/git-debrebase b/git-debrebase index f72625d6..2b257dd6 100755 --- a/git-debrebase +++ b/git-debrebase @@ -36,6 +36,8 @@ use Dpkg::Version; use File::FnMatch qw(:fnmatch); use File::Copy; +$debugcmd_when_debuglevel = 2; + our ($usage_message) = <<'END'; usages: git-debrebase [] [--|-i ] @@ -226,7 +228,7 @@ sub get_differs ($$) { unless $differs & (D_PAT_ADD|D_PAT_OTH); } - printdebug sprintf "get_differs %s, %s = %#x\n", $x, $y, $differs; + printdebug sprintf "get_differs %s %s = %#x\n", $x, $y, $differs; return $differs; } @@ -342,11 +344,11 @@ sub gbp_pq_export ($$$) { } -# xxx allow merge separately from laundering +# xxx allow merge resolution separately from laundering, before git merge # -# xxx docs highlight forbidden things -# xxx docs list allowable things ? -# xxx docs explicitly forbid some rebase +# xxx general gdr docs highlight forbidden things +# xxx general gdr docs list allowable things ? +# xxx general gdr docs explicitly forbid some rebase # # xxx provide a way for the user to help # xxx (eg, provide wreckage provide way to continue) @@ -393,6 +395,7 @@ sub merge_series ($$;@) { my @earlier; while (my $patch = ) { chomp $patch or die $!; + $prereq{$patch} //= {}; foreach my $earlier (@earlier) { $prereq{$patch}{$earlier}{$s}++ and die; } @@ -1079,8 +1082,16 @@ sub walk ($;$$$) { } die "$ty ?"; } elsif ($ty eq 'VanillaMerge' or $ty eq 'MergedBreakwaters') { - # xxx need to handle ffq if one side was unstitched - # wait both of them may be! + # 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 + # of resolving such a merge is that we may have to go back + # further in history to find a merge base, since the one + # which was reachable via ffq-prev is no longer findable. + # This is suboptimal, but if it all works we'll have done + # the right thing. + # xxx we should warn the user in the docs about this + my $ok=1; my $best_anchor; # We expect to find a dominating anchor amongst the @@ -1326,7 +1337,7 @@ sub walk ($;$$$) { }; my $final_check = get_differs $build, $input; - die sprintf "internal error %#x %s %s", $final_check, $build, $input + die sprintf "internal error %#x %s %s", $final_check, $input, $build if $final_check & ~D_PAT_ADD; my @r = ($build, $breakwater, $last_anchor);