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.