Re: [PATCH v4 0/7] builtin/repo: introduce stats subcommand
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 27, 2025, 16:33 UTC
- Message-ID
- <xmqqa52f97p1.fsf@gitster.g>
- In-Reply-To
- <20250927145049.723341-1-jltobler@gmail.com>
Justin Tobler <jltobler@gmail.com> writes:
Show 5 quoted lines
> Changes since V3: > > - Changed from using strlen() to utf8_strlen() to take into > consideration that translatable strings may have characters that are > more than one byte.
If you are truncating a string, chopping the tail end of it, you do have to take into account the fact that a single character can be more than one byte long and avoid chopping in the middle of one character.
But your use of <utf8.h> to measure the display columns for a formatted name in stats table needs a different care. You are using utf8_strwidth() to account for the fact that the number of display columns consumed to show a non-ASCII string may be different from the number of bytes in the string.
No need to resend, for the obvious reason that the cover letter material would not make into the etched-in-stone "git log" history. I just thought I should mention the above to unconfuse potential readers.