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

Re: [PATCH v2] ws: add new tab-between-non-ws check

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 8, 2026, 08:36 UTC
Message-ID
<5860c8ec-7b34-4c47-926e-67a2c44a654e@kdbg.org>
In-Reply-To
<87y0m9guns.fsf@collabora.com>
Am 07.01.26 um 19:11 schrieb Adrian Ratiu:
Show 22 quoted lines
> On Wed, 07 Jan 2026, Johannes Sixt <j6t@kdbg.org> wrote:
>> Am 07.01.26 um 02:30 schrieb Adrian Ratiu:
>>> +	git add x &&
>>> +	git diff --cached --check &&
>>> +
>>> +	git diff --cached --color >raw &&
>>> +	test_decode_color <raw >actual &&
>>> +	! test_grep "<GREEN>1234567<RESET><BLUE>	<RESET><GREEN>b<RESET>" actual &&
>>
>> This must be
>>
>> 	test_grep ! "...
>>
>> Furthermore, a negative test with a very tight pattern is often not
>> desired: The test could fail if any single character does not occur
>> (which could easily happen if the test text is changed, but not this
>> pattern). In this case, it would be sufficient to test only that "BLUE"
>> does not occur.
> 
> Thanks, I'm still a bit of a noob wrt the git codebase. Will do.
> 
>>> +	test_grep "<GREEN>1234567	b<RESET>" actual &&

Reconsidering this, we have a positive test for the desired result here. Then the negative test is redundant, I would think.

-- Hannes
Previous: Adrian RatiuNext: Johannes Sixt
Message 6 of 8 in “ws: add new tab-between-non-ws check”
  1. ws: add new tab-between-non-ws checkAdrian Ratiu, Jan 7, 2026
  2. Junio C HamanoJan 7, 2026
  3. Adrian RatiuJan 7, 2026
  4. Johannes SixtJan 7, 2026
  5. Adrian RatiuJan 7, 2026
  6. Johannes SixtJan 8, 2026
  7. Johannes SixtJan 8, 2026
  8. Adrian RatiuJan 9, 2026

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.