Subject: Re: Mark trailing whitespace error in del lines of diff

From: Junio C Hamano <[email-masked]>
Date: Mon, 25 May 2015 17:24:12 -0700

Christian Brabandt <[email-masked]>, Christian Brabandt
<[email-masked]> writes:

> As far as I can see, this does not break any tests and also the 
> behaviour of git-diff --check does not change. 

Even if this change introduced a bug that changed the behaviour
(e.g. say, exited with failure status code when only preimage had
errors), I wouldn't be surprised if no existing test caught such a
breakage.  Because the existing tests were written with the
assumption that the code to check whitespace breakages would never
look at preimage, it is plausible that no preimage line used in the
test has any whitespace error in the first place.

In other words, you'd need to add new tests that change preimage
lines with various kinds of whitespace errors into postimage lines
with and without whitespace errors, and run "diff" with various
combinations of the existing set of core.whitespace values as well
as your new one.

But as I said in the other message, I think that the approach this
patch takes goes in a wrong direction.  Instead of adding a single
"check and highlight this and only kind of breakage on preimage"
option as a new kind to existing "what kind of use of whitespaces
are errors" set, it would be more sensible to add a single "check
and highlight breakages on preimage lines as well" option that is
orthogonal to the existing ones that specify "what kind of use of
whitespaces are errors".