chiark / gitweb /
git-debrebase: merge: Prettify subprocess failures
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 18:01:20 +0000 (19:01 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 19:11:09 +0000 (20:11 +0100)
If we print STDERR in advance, there is a newline beforehand, which is
undesirable.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index d3ed731..7f96749 100755 (executable)
@@ -379,10 +379,11 @@ sub gbp_pq_export ($$$) {
 #  our own patch identification algorithm?
 #  this is an alternative strategy
 
-sub merge_failed ($$) {
-    my ($wrecknotes, $emsg) = @_;
+sub merge_failed ($$;@) {
+    my ($wrecknotes, $emsg, @xmsgs) = @_;
     my @m;
     push @m, "Merge resolution failed: $emsg";
+    push @m, @xmsgs;
 
     changedir $maindir;
 
@@ -443,8 +444,9 @@ sub merge_series ($$$;@) {
        debugcmd '+', @_;
        $!=0; $?=-1;
        if (system @_) {
-           failedcmd_report_cmd undef, @_;
-           merge_failed $wrecknotes, failedcmd_waitstatus();
+           merge_failed $wrecknotes,
+               failedcmd_waitstatus(),
+               "failed command: @_";
        }
     };