diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-07 00:13:02 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-07 00:13:02 +0100 |
commit | 27aec8c7cfd2cfd315e321d9ac335872665bcfc0 (patch) | |
tree | 64939dcf9b834650a7e2e36a123bfb19b234d82c /git-debrebase | |
parent | f854422931713c267a1a38415de478f0c2723b49 (diff) |
git-debrebase: keycommits: Callbacks get separate $mainwhy
Separate out the extra contextual info, naming the hash of the commit
being complained about, into a separate argument to $x->(). This
allows us to pass the message without that as an additional argument
to the callbacks.
This way we can still pass \&snag as a callback but other callers can
do something more sophisticated involving $cl.
No functional change for any existing callers.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-x | git-debrebase | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/git-debrebase b/git-debrebase index 04befff..292471d 100755 --- a/git-debrebase +++ b/git-debrebase @@ -568,11 +568,12 @@ sub keycommits ($;$$$$) { my $cl; $fatal //= sub { fail $_[2]; }; my $x = sub { - my ($cb, $tagsfx, $why) = @_; + my ($cb, $tagsfx, $mainwhy, $xwhy) = @_; + my $why = $mainwhy.$xwhy; my $m = "branch needs laundering (run git-debrebase): $why"; fail $m unless defined $cb; return unless $cb; - $cb->("unclean-$tagsfx", $why, $cl); + $cb->("unclean-$tagsfx", $why, $cl, $mainwhy); }; for (;;) { $cl = classify $head; @@ -593,27 +594,27 @@ sub keycommits ($;$$$$) { last; } elsif ($ty eq 'Upstream') { $x->($unclean, 'ordering', - "packaging change ($breakwater) follows upstream change (eg $head)") + "packaging change ($breakwater) follows upstream change"," (eg $head)") if defined $breakwater; $clogonly = undef; $breakwater = undef; } elsif ($ty eq 'Mixed') { $x->($unclean, 'mixed', - "found mixed upstream/packaging commit ($head)"); + "found mixed upstream/packaging commit"," ($head)"); $clogonly = undef; $breakwater = undef; } elsif ($ty eq 'Pseudomerge' or $ty eq 'AddPatches') { $x->($furniture, (lc $ty), - "found interchange bureaucracy commit ($ty, $head)"); + "found interchange bureaucracy commit ($ty)"," ($head)"); } elsif ($ty eq 'DgitImportUnpatched') { $x->($trouble, 'dgitimport', "found dgit dsc import ($head)"); return (undef,undef); } else { $x->($fatal, 'unprocessable', - "found unprocessable commit, cannot cope: $head; $cl->{Why}" - ); + "found unprocessable commit, cannot cope: $cl->{Why}", + " ($head)"); return (undef,undef); } $head = $cl->{Parents}[0]{CommitId}; |