From: Junio C Hamano Date: Fri, 27 Feb 2026 18:08:39 GMT Subject: Re: [GSoC PATCH v2 2/2] t4052: add test for diffstat width when prefix contains UTF-8 chars Message-ID: In-Reply-To: <984fa10d728aad049d0430472e85f1ed0e5ea4de.1772136203.git.lorenzo.pegorari2002@gmail.com> LorenzoPegorari 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: > +# "| ${FILENAME} | 0" > +# where "" and "" 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 ;-)