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

From: Adrian Ratiu <[email-masked]>
Date: Mon, 05 Jan 2026 22:59:51 +0200

On Wed, 24 Dec 2025, Junio C Hamano <[email-masked]> wrote:
> 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.