Re: Mark trailing whitespace error in del lines of diff
- From
- Christian Brabandt <cblists@256bit.org>
- Date
- May 26, 2015, 16:31 UTC
- Message-ID
- <20150526163108.GB24439@256bit.org>
- In-Reply-To
- <xmqq617g9oer.fsf@gitster.dls.corp.google.com>
Hi Junio!
On Mo, 25 Mai 2015, Junio C Hamano wrote:
Show 28 quoted lines
> Christian Brabandt <cblists@256bit.org>, Christian Brabandt > <cb@256bit.org> 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".
Oh well, too bad. It sounded like a good idea...
Best, Christian
-- Unser Gefühl für Natur gleicht der Empfindung des Kranken für die Gesundheit. -- Friedrich Johann Christoph Schiller