git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Mark trailing whitespace error in del lines of diff

From
Junio C Hamano <gitster@pobox.com>
Date
May 26, 2015, 17:33 UTC
Message-ID
<xmqqa8wrkzur.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150526163108.GB24439@256bit.org>
Christian Brabandt <cblists@256bit.org> writes:
Show 10 quoted lines
>> 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...

Oh, don't get me wrong. I do not think it is not a good idea (i.e. problem and general strategy to solve it).

Problem:
    Sometimes it is desirable to keep existing whitespace breakages
    while working on fixes and other changes of substance.  The user
    however gets whitespace errors painted only on new lines in the
    output from "git diff", and this makes it hard to tell if they
    were introduced by the user's change or came from the original.
Strategy:
    By painting whitespace breakages in the old lines, the user can
    eyeball and find the corresponding old lines when whitespace
    errors on new lines are painted.  If the corresponding old lines
    have the same errors, the user can see they were inherited from
    the original.

These may be a pair of reasonable problem to solve and a general strategy to solve it.

What I said was *not* good was the particular execution, the approach that the patch took.

Previous: Christian Brabandt
Message 30 of 30 in “Mark trailing whitespace error in del lines of diff”
  1. Christian BrabandtMay 25, 2015
  2. brian m. carlsonMay 25, 2015
  3. Junio C HamanoMay 25, 2015
  4. brian m. carlsonMay 25, 2015
  5. Christian BrabandtMay 26, 2015
  6. Junio C HamanoMay 26, 2015
  7. Junio C HamanoMay 26, 2015
  8. Christian BrabandtMay 26, 2015
  9. Junio C HamanoMay 26, 2015
  10. Christian BrabandtMay 26, 2015
  11. 0/5 showing existing ws breakageJunio C Hamano, May 26, 2015
  12. 1/4 t4015: modernise styleJunio C Hamano, May 26, 2015
  13. 2/4 t4015: separate common setup and per-test expectationJunio C Hamano, May 26, 2015
  14. 3/4 diff.c: add emit_del_line() and update callers of emit_line_0()Junio C Hamano, May 26, 2015
  15. 4/4 diff.c: --ws-check-deleted optionJunio C Hamano, May 26, 2015
  16. 0/4 showing existing ws breakageJunio C Hamano, May 27, 2015
  17. 1/4 t4015: modernise styleJunio C Hamano, May 27, 2015
  18. 2/4 t4015: separate common setup and per-test expectationJunio C Hamano, May 27, 2015
  19. 3/4 diff.c: add emit_del_line() and emit_context_line()Junio C Hamano, May 27, 2015
  20. 4/4 diff.c: --ws-error-highlight=<kind> optionJunio C Hamano, May 27, 2015
  21. Jeff KingMay 27, 2015
  22. Junio C HamanoMay 27, 2015
  23. Jeff KingMay 27, 2015
  24. Junio C HamanoMay 27, 2015
  25. Jeff KingMay 27, 2015
  26. Junio C HamanoMay 27, 2015
  27. Jeff KingMay 27, 2015
  28. Junio C HamanoMay 26, 2015
  29. Christian BrabandtMay 26, 2015
  30. Junio C HamanoMay 26, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.