chiark / gitweb /
dgit: Fix suggested diff rune in split brain mode
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 6 Jan 2018 01:50:00 +0000 (01:50 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 6 Jan 2018 01:50:01 +0000 (01:50 +0000)
In split brain mode, with unexpected diffs, print dgit view commitid
in suggested diff rune.

HEAD is wrong in this case.

Closes:#886443.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit

index 087dc21..aa98a41 100644 (file)
@@ -10,6 +10,8 @@ dgit (4.2~) experimental; urgency=medium
     Sean Whitton]  Closes:#856402.
 
   Minor fixes:
+  * In split brain mode, with unexpected diffs, print dgit view
+    commitid in suggested diff rune.  (HEAD is wrong.)  Closes:#886443.
   * Fix message about missing quilt cache entry to refer to
     HEAD rather than tree, since dgit needs a commit.  Closes:#884646.
   * Fix grammar error in 4.1 changelog entry. [Sean Whitton]
diff --git a/dgit b/dgit
index 3a9b46c..aa8f771 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4238,13 +4238,14 @@ END
     my $r = system @diffcmd;
     if ($r) {
        if ($r==256) {
+           my $referent = $split_brain ? $dgithead : 'HEAD';
            my $diffs = cmdoutput @git, qw(diff --stat), $tree, $dgithead;
            fail <<END
 HEAD specifies a different tree to $dscfn:
 $diffs
 Perhaps you forgot to build.  Or perhaps there is a problem with your
  source tree (see dgit(7) for some hints).  To see a full diff, run
-   git diff $tree HEAD
+   git diff $tree $referent
 END
        } else {
            failedcmd @diffcmd;