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

Re: [PATCH] diff: handle lines containing only whitespace better

From
Kevin Ballard <kevin@sb.org>
Date
Oct 20, 2010, 06:38 UTC
Message-ID
<780B144B-03E0-4ED5-8E92-D4EB3CBBBF71@sb.org>
In-Reply-To
<7vzku9wfrp.fsf@alter.siamese.dyndns.org>
On Oct 19, 2010, at 11:16 PM, Junio C Hamano wrote:
> Hmm, tests?
I checked, there seem to be no existing tests for the whitespace highlighting output. All the tests just use `git diff --check` to see if it was caught. And given that the problem only occurs when it's emitting the colored highlighting, I wasn't sure how to go about adding tests for this as I'd need to create an expect file that contains all the same ansi color codes, and I thought that might be a bit fragile or hard to do correctly.
Incidentally, I just realized the description of the patch is slightly wrong. The problem only occurs when the line contains at least one tab. Should I resend the patch with an updated description? I can also attempt to write tests if you can give me some guidance on how to deal with the need for ansi color codes.
-Kevin Ballard
Previous: Junio C HamanoNext: Nazri Ramliy
Message 3 of 9 in “diff: handle lines containing only whitespace better”
  1. diff: handle lines containing only whitespace betterKevin Ballard, Oct 20, 2010
  2. Junio C HamanoOct 20, 2010
  3. Kevin BallardOct 20, 2010
  4. Nazri RamliyOct 20, 2010
  5. Junio C HamanoOct 20, 2010
  6. 1/2 test-lib: extend test_decode_color to handle more color codesKevin Ballard, Oct 20, 2010
  7. Junio C HamanoOct 20, 2010
  8. Kevin BallardOct 21, 2010
  9. 2/2 diff: handle lines containing only whitespace and tabs betterKevin Ballard, Oct 20, 2010

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.