diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-01-06 02:22:05 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-01-06 02:22:06 +0000 |
commit | 8b74ec543cd65112bd83f57dad5c7dcffb592224 (patch) | |
tree | a13297214c869e61524f0f5618e3e31104f7741e | |
parent | ef9fb96766ba8b8eaba540a760efa4db4b1bb5da (diff) |
dgit: When source discrepancy involves mode changes, report them specially.
Closes:#886442.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | debian/changelog | 2 | ||||
-rwxr-xr-x | dgit | 30 |
2 files changed, 31 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index aa98a41..591ee67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ dgit (4.2~) experimental; urgency=medium Sean Whitton] Closes:#856402. Minor fixes: + * When source discrepancy involves file mode changes, report them + specially. Closes:#886442. * 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 @@ -4240,7 +4240,35 @@ END if ($r==256) { my $referent = $split_brain ? $dgithead : 'HEAD'; my $diffs = cmdoutput @git, qw(diff --stat), $tree, $dgithead; - fail <<END + + my @mode_changes; + my $raw = cmdoutput @git, + qw(diff --no-renames -z -r --raw), $tree, $dgithead; + my $changed; + foreach (split /\0/, $raw) { + if (defined $changed) { + push @mode_changes, "$changed: $_\n" if $changed; + $changed = undef; + next; + } elsif (m/^:0+ 0+ /) { + $changed = ''; + } elsif (m/^:(?:10*)?(\d+) (?:10*)?(\d+) /) { + $changed = "Mode change from $1 to $2" + } else { + die "$_ ?"; + } + } + if (@mode_changes) { + fail <<END.(join '', @mode_changes).<<END; +HEAD specifies a different tree to $dscfn: +$diffs +END +There is a problem with your source tree (see dgit(7) for some hints). +To see a full diff, run git diff $tree $referent +END + } + + fail <<END; HEAD specifies a different tree to $dscfn: $diffs Perhaps you forgot to build. Or perhaps there is a problem with your |