chiark / gitweb /
Do not spew diff output to terminal (by default). Closes:#736526.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 3 Aug 2014 16:39:37 +0000 (17:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 3 Aug 2014 16:39:37 +0000 (17:39 +0100)
debian/changelog
dgit

index bd08454e7ebf36618d1ab6c0bcc5c0d8e5e9dacb..f0f2eb90b0fe1d5a1ec9c714bf1a7f9d28c2b6e5 100644 (file)
@@ -9,6 +9,7 @@ dgit (0.22~experimental1) experimental; urgency=low
   * Include canonicalised suite name in signed tag message.
   * Mention cross-version dgit rpush incompatibility in manpage.
   * New script tests/using-intree for running tests on the source tree.
+  * Do not spew diff output to terminal (by default).  Closes:#736526.
 
   Major new feature, currently stalled awaiting server infrastructure:
   * dgit-repos-server: New program for receiving signed-tag-based
diff --git a/dgit b/dgit
index 4b218a3b2c8d46870a8691444f03c90b8610e554..1fdca6c031d113b221fa64e55be0fa54625a5109 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1391,13 +1391,16 @@ sub dopush () {
         $dscpath =~ m#^/# ? $dscpath : "../../../$dscpath";
     my ($tree,$dir) = mktree_in_ud_from_only_subdir();
     changedir '../../../..';
-    my @diffcmd = (@git, qw(diff --exit-code), $tree);
+    my $diffopt = $debug>0 ? '--exit-code' : '--quiet';
+    my @diffcmd = (@git, qw(diff), $diffopt, $tree);
     printcmd \*DEBUG,$debugprefix."+",@diffcmd;
     $!=0; $?=0;
     if (system @diffcmd) {
        if ($! && $?==256) {
            fail "$dscfn specifies a different tree to your HEAD commit;".
-               " perhaps you forgot to build";
+               " perhaps you forgot to build".
+               ($diffopt eq '--exit-code' ? "" :
+                " (run with -D to see full diff output)");
        } else {
            failedcmd @diffcmd;
        }