chiark / gitweb /
git-debrebase: make-patched: Provide --quiet-would-amend
[dgit.git] / git-debrebase
index 3cab3ad8837b4a28a4bc51be3bcad29d123ebd20..e5cafd1c4850a7192fe21e06851931963eb12b26 100755 (executable)
@@ -1505,6 +1505,9 @@ sub make_patches ($) {
 }
 
 sub cmd_make_patches () {
+    my $opt_quiet_would_amend;
+    GetOptions('quiet-would-amend!', \$opt_quiet_would_amend)
+       or die badusage("bad options to make-patches");
     badusage "no arguments allowed" if @ARGV;
     my $old_head = get_head();
     my $new = make_patches $old_head;
@@ -1516,9 +1519,12 @@ sub cmd_make_patches () {
        snags_maybe_bail();
        update_head_checkout $old_head, $new, 'make-patches';
     } else {
-       fail "Patch export produced patch amendments".
+       print STDERR failmsg
+           "Patch export produced patch amendments".
            " (abandoned output commit $new).".
-           "  Try laundering first.";
+           "  Try laundering first."
+           unless $opt_quiet_would_amend;
+       finish 7;
     }
 }