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

Re: Mark trailing whitespace error in del lines of diff

From
CBChristian Brabandt <cblists@256bit.org>
Date
May 26, 2015, 16:29 UTC
Message-ID
<20150526162937.GA24439@256bit.org>
In-Reply-To
<xmqqbnh89r0z.fsf@gitster.dls.corp.google.com>
Hi Junio!
On Mo, 25 Mai 2015, Junio C Hamano wrote:
Show 17 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > I like this idea.
> 
> I don't.
> 
> > My use case is determining whether a patch to a pristine-tar
> > repository introduced trailing whitespace (which is not okay) or
> > just left it there (which is okay).
> 
> In your use case, where keeping trailing blank that is otherwise not
> OK is fine only when the breakage was inherited from the preimage,
> wouldn't it be equally fine to keep other kinds of breakages as long
> as they were inherited from the preimage?  E.g. "The original used
> 8-space as leading indent, and you would not use that for your new
> lines, but the breakage was inherited from the preimage" would want
> to be treated the same way, no?  Why trailing blanks so special?

It was the one I am interesting in and also the one that I usually try to avoid ;)

(In fact, I thought if the other options would be needed, one could add additional suboptions for core.whitespace as well, so one would be able to exactly say, what kind of things one would like to see and which could be different for new lines and old lines).

> 
> So, from that point of view, your "use case" does not justify this
> particular implementation that special-cases trailing blanks on
> deleted lines and mark them [*1*].
Show 6 quoted lines
> 
> If the implementation were addition of a new option to check and
> mark all kinds of errors core.whitespace would catch for new lines
> also for old lines, then it would be a somewhat different story.  I
> personally do not find such an option interesting, but at least I
> can understand why some people might find it useful.

Wouldn't that mean, that one couldn't see different kind of whitespace markings for newlines and deleted lines? I don't know, if one would want that a configuration however.

However, as I don't know the codebase very well, I doubt I can implement this.

Show 8 quoted lines
> [Footnote]
> 
> *1* To support your use case with the ultimate ease-of-use, it would
> be best if the new option were to squelch the whitespace error on
> the new line when it was inherited from the old line, which is
> different from showing and marking the breakage on the old line.
> But I do not think it can be implemented sanely, so I will not go
> there.

Aside from the difficulties it would take to do this, personally, I don't like this option. Because I like to see such problems, but just want to know whether a particular patch has introduced the problem or not.

Best, Christian

-- 
In den Fragen im gemeinen Leben, wie man etwas am besten tun könnte,
wird ein gewisses Maximum gesucht.
		-- Georg Christoph Lichtenberg
Previous: brian m. carlsonNext: Junio C Hamano
Message 5 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.