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

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

From
Adrian Ratiu <adrian.ratiu@collabora.com>
Date
Jan 5, 2026, 20:59 UTC
Message-ID
<875x9fai7s.fsf@gentoo.mail-host-address-is-not-set>
In-Reply-To
<xmqq5x9wpvor.fsf@gitster.g>
On Wed, 24 Dec 2025, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> The above is sufficient to make "git diff --check" and "git apply
> --whitespace=warn" notice, but the code change in this patch is not
> sufficient.
>
>  * Colored "git diff" output needs to highlight whitespace errors.
>    diff.c:diff_colors[] tells us to use BG_RED to paint them by
>    default.  At the end of ws_check_emit_1(), when stream is not
>    NULL, we emit the middle segment as-is, but when this new
>    whitespace error class is in effect, that part needs to paint the
>    tab at 7th column between !isspace() bytes.  Introduce a helper
>    function "static emit_middle_section()" to do so, perhaps.
>
>  * "git apply --whitespace=fix" needs to turn such a HT to a SP.
>    This is probably done in ws_fix_copy().
>
> Thanks.

It took me a while, however I now have all functionality working properly. Just need to cleanup the code a bit, add the extra tests and will send a v2 very soon.

Thank you for your feedback and patience.
Previous: Junio C Hamano
Message 3 of 3 in “ws: add new tab-between-non-ws check”
  1. ws: add new tab-between-non-ws checkAdrian Ratiu, Dec 23, 2025
  2. Junio C HamanoDec 24, 2025
  3. Adrian RatiuJan 5, 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.