path: root/dgit
diff options
authorIan Jackson <>2018-01-06 01:50:00 +0000
committerIan Jackson <>2018-01-06 01:50:01 +0000
commitef9fb96766ba8b8eaba540a760efa4db4b1bb5da (patch)
tree58b570a199783f262fd848d8a59a73dcf3520307 /dgit
parent0f141266f28e1cf9ffb421d7362596825fbe6acb (diff)
dgit: Fix suggested diff rune in split brain mode
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 <>
Diffstat (limited to 'dgit')
1 files changed, 2 insertions, 1 deletions
diff --git a/dgit b/dgit
index 3a9b46c..aa8f771 100755
--- 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:
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
} else {
failedcmd @diffcmd;