chiark / gitweb /
git-debrebase: when dieing due to bad commit, print differs
[dgit.git] / git-debrebase
index 5d1e9c3dc99bf16ffa3605c1e999303a15e28770..dd1ddb0a9cc7d350323d33e7a3ff9350c1f4686e 100755 (executable)
@@ -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;