chiark / gitweb /
git-debrebase: trees_diff_walk: Support recursion
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 83d1d09fb740bafd9aca93e8f080e468ea3775f1..1f1b0f59b432484f63c823b8345ab42493a3ba26 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -311,7 +311,7 @@ sub branch_is_gdr_unstitched_ff ($$$) {
     my ($symref, $head, $ancestor) = @_;
     my ($ffq_prev, $gdrlast) = branch_gdr_info($symref, $head);
     return 0 unless $ffq_prev;
-    return 0 unless is_fast_fwd $ancestor, $ffq_prev;
+    return 0 unless !defined $ancestor or is_fast_fwd $ancestor, $ffq_prev;
     return 1;
 }
 
@@ -4476,9 +4476,8 @@ END
     supplementary_message(<<'END');
 Push failed, while obtaining signatures on the .changes and .dsc.
 If it was just that the signature failed, you may try again by using
-debsign by hand to sign the changes
-   $changesfile
-and then dput to complete the upload.
+debsign by hand to sign the changes file (see the command dgit tried,
+above), and then dput that changes file to complete the upload.
 If you need to change the package, you must use a new version number.
 END
     if ($we_are_responder) {
@@ -5368,10 +5367,17 @@ sub quiltify ($$$$) {
        };
        if ($quilt_mode eq 'linear') {
            print STDERR "\n$us: error: quilt fixup cannot be linear.  Stopped at:\n";
+           my $all_gdr = !!@nots;
            foreach my $notp (@nots) {
                print STDERR "$us:  ", $reportnot->($notp), "\n";
+               $all_gdr &&= $notp->{Child} &&
+                   (git_cat_file $notp->{Child}{Commit}, 'commit')
+                   =~ m{^\[git-debrebase.*\]$}m;
            }
            print STDERR "\n";
+           $failsuggestion =
+               [ grep { $_->[0] ne 'quilt-mode' } @$failsuggestion ]
+               if $all_gdr;
            print STDERR "$us: $_->[1]\n" foreach @$failsuggestion;
            fail
  "quilt history linearisation failed.  Search \`quilt fixup' in dgit(7).\n";
@@ -5921,10 +5927,15 @@ END
         push @failsuggestion, [ 'applied',
                                "This might be a patches-applied branch." ];
     }
-    push @failsuggestion, [ 'quilt-mode', "Maybe you need to specify one of".
-        " --[quilt=]gbp --[quilt=]dpm --quilt=unapplied ?" ],
-           [ 'origs',
- "Or, maybe orig tarball(s) are not identical to git representation?" ];
+    push @failsuggestion, [ 'quilt-mode',
+ "Maybe you need one of --[quilt=]gbp --[quilt=]dpm --quilt=unapplied ?" ];
+
+    push @failsuggestion, [ 'gitattrs',
+ "Warning: Tree has .gitattributes.  See GITATTRIBUTES in dgit(7)." ]
+       if stat_exists '.gitattributes';
+
+    push @failsuggestion, [ 'origs',
+ "Maybe orig tarball(s) are not identical to git representation?" ];
 
     if (quiltmode_splitbrain()) {
        quiltify_splitbrain($clogp, $unapplied, $headref, $oldtiptree,