diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-21 00:34:03 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-21 01:11:11 +0100 |
commit | 1dd14bbf4f9cb4b6e973aa2813070c0847d71c31 (patch) | |
tree | 08d99e3ce31d704d7bd03ef41f9b45dafa5881db | |
parent | 630bf678ac46457cb33f8f15ab4cdeed3c64ebe1 (diff) |
dgit: Improve message for discrepant quilt fixup
When quilt fixup fails because of discrepancies, print a git diff rune
which will show them. Closes:#865446.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | debian/changelog | 2 | ||||
-rwxr-xr-x | dgit | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index da73430..3216e4a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ dgit (5.2~) unstable; urgency=medium * When build fails because the network is offline, mention that this is because --since-version was not specified. Closes:#883340. + * When quilt fixup fails because of discrepancies, print a + git diff rune which will show them. Closes:#865446. -- @@ -5065,10 +5065,12 @@ sub quiltify_splitbrain_needed () { sub quiltify_splitbrain ($$$$$$$) { my ($clogp, $unapplied, $headref, $oldtiptree, $diffbits, $editedignores, $cachekey) = @_; + my $gitignore_special = 1; if ($quilt_mode !~ m/gbp|dpm/) { # treat .gitignore just like any other upstream file $diffbits = { %$diffbits }; $_ = !!$_ foreach values %$diffbits; + $gitignore_special = 0; } # We would like any commits we generate to be reproducible my @authline = clogp_authline($clogp); @@ -5079,11 +5081,19 @@ sub quiltify_splitbrain ($$$$$$$) { local $ENV{GIT_AUTHOR_EMAIL} = $authline[1]; local $ENV{GIT_AUTHOR_DATE} = $authline[2]; + my $fulldiffhint = sub { + my ($x,$y) = @_; + my $cmd = "git diff $x $y -- :/ ':!debian'"; + $cmd .= " ':!/.gitignore' ':!*/.gitignore'" if $gitignore_special; + return "\nFor full diff showing the problem(s), type:\n $cmd\n"; + }; + if ($quilt_mode =~ m/gbp|unapplied/ && ($diffbits->{O2H} & 01)) { my $msg = "--quilt=$quilt_mode specified, implying patches-unapplied git tree\n". " but git tree differs from orig in upstream files."; + $msg .= $fulldiffhint->($unapplied, 'HEAD'); if (!stat_exists "debian/patches") { $msg .= "\n ... debian/patches is missing; perhaps this is a patch queue branch?"; @@ -5092,7 +5102,7 @@ sub quiltify_splitbrain ($$$$$$$) { } if ($quilt_mode =~ m/dpm/ && ($diffbits->{H2A} & 01)) { - fail <<END; + fail <<END. $fulldiffhint->($oldtiptree,'HEAD'); --quilt=$quilt_mode specified, implying patches-applied git tree but git tree differs from result of applying debian/patches to upstream END @@ -5108,7 +5118,7 @@ END } if ($quilt_mode =~ m/gbp|dpm/ && ($diffbits->{O2A} & 02)) { - fail <<END + fail <<END; --quilt=$quilt_mode specified, implying that HEAD is for use with a tool which does not create patches for changes to upstream .gitignores: but, such patches exist in debian/patches. |