chiark / gitweb /
New import: Tidy up output from gbp pq
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Oct 2016 21:01:12 +0000 (22:01 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Oct 2016 22:05:47 +0000 (23:05 +0100)
gbp pq import can print some warnings if it doesn't like the patches
much.  There is no point showing these warnings to the user of `dgit
clone' or `dgit fetch'.

As for the warnings in split brain mode, we will leave those, and
leave them with colour enabled.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
TODO.BRANCH
dgit

index 0951402cbd7c231b66690dc3303e58cfe27a9552..ec77c734e667b63335a95ff3c4cf6e59e5bcfc8e 100644 (file)
@@ -5,9 +5,6 @@ OTHER
    Honour (and strip) Gbp-Pq Topic and Gbp-Pq Name
 
  * Provide --gpbpq[=:] options
- * When invoking gbp pq internally, use --color=off
- * When invoking gbp pq during import, redirect stderr
-   and print only on failure
 
  * Fix up README.dsc-import to describe actual algorithm as implemented
 
diff --git a/dgit b/dgit
index cdf16700d4b9053f146731f6b68382a3e9f88cde..def2c349af4668589df46d30c7ba09d61b7a8d72 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1843,7 +1843,14 @@ END
        local $ENV{GIT_AUTHOR_EMAIL} = $authline[1];
        local $ENV{GIT_AUTHOR_DATE} =  $authline[2];
 
-       runcmd shell_cmd 'exec >/dev/null', @gbp, qw(pq import);
+       eval {
+           runcmd shell_cmd 'exec >/dev/null 2>../../gbp-pq-output',
+               @gbp, qw(pq import);
+       };
+       if ($@) {
+           { local $@; eval { runcmd qw(cat ../../gbp-pq-output); }; }
+           die $@;
+       }
 
        my $gapplied = git_rev_parse('HEAD');
        my $gappliedtree = cmdoutput @git, qw(rev-parse HEAD:);