From: Ian Jackson Date: Sun, 6 Jan 2019 11:36:52 +0000 (+0000) Subject: dgit: cleaning: Improve handling of note about ignores X-Git-Tag: archive/debian/8.3~23 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=a73c60edeaaf776cee0b9065b25ce312baccc49b dgit: cleaning: Improve handling of note about ignores * Provide a new $ignmessage parameter to clean_tree_check_git and use that. This makes it a bit easier to: * Only print the additional message if the clean mode actually honoured ignores. If it didn't then the problem is not `due to missing .gitignore entries' because they would not have helped. * Change all callers other than clean_tree_check_git_wd to pass the empty string, so no other overall functional change. Signed-off-by: Ian Jackson --- diff --git a/dgit b/dgit index 22441d7e..988eb948 100755 --- a/dgit +++ b/dgit @@ -6213,13 +6213,14 @@ sub maybe_unapply_patches_again () { #----- other building ----- -sub clean_tree_check_git ($$) { - my ($honour_ignores, $message) = @_; +sub clean_tree_check_git ($$$) { + my ($honour_ignores, $message, $ignmessage) = @_; my @cmd = (@git, qw(clean -dn)); push @cmd, qw(-x) unless $honour_ignores; my $leftovers = cmdoutput @cmd; if (length $leftovers) { print STDERR $leftovers, "\n" or confess $!; + $message .= $ignmessage if $honour_ignores; fail $message; } } @@ -6229,8 +6230,7 @@ sub clean_tree_check_git_wd ($) { return if $cleanmode =~ m{no-check}; return if $patches_applied_dirtily; # yuk clean_tree_check_git +($cleanmode !~ m{all-check}), - (f_ <