Subject: Re: [PATCH 2/6] builtin/repo: humanise count values in structure output

From: Junio C Hamano <[email-masked]>
Date: Thu, 11 Dec 2025 11:57:19 +0900

Justin Tobler <[email-masked]> writes:

> On 25/12/10 07:28AM, Patrick Steinhardt wrote:
>> On Tue, Dec 09, 2025 at 04:58:16PM -0600, Justin Tobler wrote:
>> > diff --git a/builtin/repo.c b/builtin/repo.c
>> > index a69699857a..8fb728b3a5 100644
>> > --- a/builtin/repo.c
>> > +++ b/builtin/repo.c
>> > @@ -266,6 +275,10 @@ static void stats_table_addf(struct stats_table *table, const char *format, ...)
>> >  	va_end(ap);
>> >  }
>> >  
>> > +static const char *unit_k = "k";
>> > +static const char *unit_M = "M";
>> > +static const char *unit_G = "G";
>> > +
>> >  static void stats_table_count_addf(struct stats_table *table, size_t value,
>> >  				   const char *format, ...)
>> >  {
>> 
>> I would assume that these units should be translatable.
>
> Ya, you are right. I'll make units translatable in the next version.

Whatever you do, please first consider reusing existing
"human-readable numbers" helpers, like strbuf_humanise_bytes() used
by the progress.c for showing throughput, before rolling your own
variant like the above.

Thanks.