Thread (2 messages) 2 messages, 2 authors, 2026-01-05

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

From: Adrian Ratiu <hidden>
Date: 2026-01-05 21:00:05

On Wed, 24 Dec 2025, Junio C Hamano [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help