X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=git-debrebase;h=139602fcff8e5fa22f8f48f378afbdcdaa6f96a6;hb=c4a29f2072aa18aa1d916c61afd723b38ace7838;hp=5d1e9c3dc99bf16ffa3605c1e999303a15e28770;hpb=0e8a298a68f8b71c57551659ee1b8c4bbe263374;p=dgit.git diff --git a/git-debrebase b/git-debrebase index 5d1e9c3d..139602fc 100755 --- a/git-debrebase +++ b/git-debrebase @@ -212,7 +212,7 @@ sub get_differs ($$) { } die unless s{^debian/patches/}{}; my $ok; - if ($mode eq 'A' && !m/(?:^|\.)series$/s) { + if ($mode eq 'A' && !m/\.series$/s) { $ok = 1; } elsif ($mode eq 'M' && $_ eq 'series') { my $x_s = git_cat_file "$x:debian/patches/series", 'blob'; @@ -305,7 +305,7 @@ sub classify ($) { push @p, { Ix => $#p, CommitId => $ph, - Differs => (get_differs $t, $ph), + Differs => (get_differs $ph, $t), }; } @@ -475,7 +475,9 @@ sub walk ($;$$) { if ($nogenerate) { return (undef,undef); } - die "commit $cur: Cannot cope with this commit"; + die "commit $cur: Cannot cope with this commit (d.". + (join ' ', map { sprintf "%#x", $_->{Differs} } + @{ $cl->{Parents} }). ")"; }; my $build; @@ -513,7 +515,7 @@ sub walk ($;$$) { } elsif ($ty eq 'Mixed') { my $queue = sub { my ($q, $wh) = @_; - my $cls = { $cl, $xmsg->("split mixed commit: $wh part") }; + my $cls = { %$cl, $xmsg->("split mixed commit: $wh part") }; push @$q, $cls; }; $queue->(\@brw_cl, "debian"); @@ -663,7 +665,7 @@ sub walk ($;$$) { $ch =~ s{^tree .*}{tree $newtree}m or confess "$ch ?"; $ch =~ s{^parent .*\n}{}m; $ch =~ s{(?=^author)}{ - map { "parent $_\n" } @parents + join '', map { "parent $_\n" } @parents }me or confess "$ch ?"; if ($rewriting) { $ch =~ s{^committer .*$}{$committer_authline}m @@ -682,7 +684,9 @@ sub walk ($;$$) { } }; - runcmd @git, qw(diff-tree --quiet), $input, $build; + my $final_check = get_differs $build, $input; + die sprintf "internal error %#x", $final_check + if $final_check & ~D_PAT_ADD; return ($build, $breakwater); } @@ -707,8 +711,9 @@ sub cmd_launder () { my ($tip,$breakwater) = walk $old; update_head $old, $tip, 'launder'; # no tree changes except debian/patches - runcmd @git, qw(rm --quiet -rf debian/patches); + runcmd @git, qw(rm --quiet --ignore-unmatch -rf debian/patches); printf "# breakwater tip\n%s\n", $breakwater; + printf "# working tip\n%s\n", $tip; } sub cmd_analyse () {