From: Junio C Hamano <gitster@pobox.com>
To: LorenzoPegorari <lorenzo.pegorari2002@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [GSoC PATCH v2 2/2] t4052: add test for diffstat width when prefix contains UTF-8 chars
Date: Fri, 27 Feb 2026 10:08:39 -0800 [thread overview]
Message-ID: <xmqq1pi6rrdk.fsf@gitster.g> (raw)
In-Reply-To: <984fa10d728aad049d0430472e85f1ed0e5ea4de.1772136203.git.lorenzo.pegorari2002@gmail.com> (LorenzoPegorari's message of "Fri, 27 Feb 2026 17:08:12 +0100")
LorenzoPegorari <lorenzo.pegorari2002@gmail.com> writes:
> Add test checking the calculation of the diffstat display width when the
> `line_prefix`, which is text that goes before the diffstat, contains
> UTF-8 characters.
This does not want to say UTF-8 for two reasons. US-ASCII is a
subset of UTF-8, and more importantly, most of the problems
miscounting the display width of the line-prefix part comes from the
fact that ANSI color escapes are 0-width but consumes strlen() bytes.
Curiously ...
> +# git-log will print only 1 commit containing a single branch graph and a diffstat.
> +# The diffstat will be only one file, with a placeholder FILENAME, that, with
> +# enough terminal display width, will contain the following line:
> +# "<RED>|<RESET> ${FILENAME} | 0"
> +# where "<RED>" and "<RESET>" are ANSI escape codes to color the text.
... this does say "ANSI escape codes to color the text", which is
exactly what we want to say ;-)
next prev parent reply other threads:[~2026-02-27 18:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 1:09 [GSoC PATCH 0/2] diff: handle ANSI chars in prefix when calculating diffstat width LorenzoPegorari
2026-02-24 1:11 ` [GSoC PATCH 1/2] " LorenzoPegorari
2026-02-24 1:20 ` [GSoC PATCH 2/2] t4074: add test for diffstat width when prefix contains ANSI chars LorenzoPegorari
2026-02-24 5:43 ` Junio C Hamano
2026-02-25 2:18 ` Lorenzo Pegorari
2026-02-24 5:17 ` [GSoC PATCH 0/2] diff: handle ANSI chars in prefix when calculating diffstat width Junio C Hamano
2026-02-27 16:01 ` [GSoC PATCH v2 0/2] diff: handle UTF-8 " LorenzoPegorari
2026-02-27 16:04 ` [GSoC PATCH v2 1/2] " LorenzoPegorari
2026-02-27 16:08 ` [GSoC PATCH v2 2/2] t4052: add test for diffstat width when prefix contains UTF-8 chars LorenzoPegorari
2026-02-27 18:08 ` Junio C Hamano [this message]
2026-02-27 18:04 ` [GSoC PATCH v2 0/2] diff: handle UTF-8 chars in prefix when calculating diffstat width Junio C Hamano
2026-02-27 21:43 ` [GSoC PATCH v3 0/2] diff: handle ANSI escape codes " LorenzoPegorari
2026-02-27 21:45 ` [GSoC PATCH v3 1/2] " LorenzoPegorari
2026-02-27 21:48 ` [GSoC PATCH v3 2/2] t4052: test for diffstat width when prefix contains ANSI escape codes LorenzoPegorari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq1pi6rrdk.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=lorenzo.pegorari2002@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.