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 087dc2169e07a2b6a71bc14d66f27872e18e2d08..aa98a41a01c1d503031454c4d60f2ad31986462a 100644 (file)
@@ -10,6 +10,8 @@ dgit (4.2~) experimental; urgency=medium
     Sean Whitton]  Closes:#856402.
 
   Minor fixes:
     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]
   * 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 3a9b46c13330bd9931ea46bb72cebf9175adf4eb..aa8f7717248023e2fc86029b206fc0050109010d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4238,13 +4238,14 @@ END
     my $r = system @diffcmd;
     if ($r) {
        if ($r==256) {
     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
            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;
 END
        } else {
            failedcmd @diffcmd;