git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] log-tree: use decimal_width()

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2024, 16:03 UTC
Message-ID
<xmqqh6bz3qkj.fsf@gitster.g>
In-Reply-To
<Zq+oEby6ew3HrWFK@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 14 quoted lines
> On Sat, Aug 03, 2024 at 02:33:24PM +0200, René Scharfe wrote:
>> ---
>>  log-tree.c | 13 ++-----------
>>  1 file changed, 2 insertions(+), 11 deletions(-)
>
> This looks all very reasonable to me.
>
> Some history (if interesting): lineno_width(), which was the precursor
> to decimal_width() was introduced way back in cee7f245dc (git-pickaxe:
> blame rewritten., 2006-10-19). The piece this patch removes was added in
> e00de24b10 (format-patch -n: make sorting easier by padding number,
> 2007-02-09), but lineno_width() did not become part of pager.h until
> ec7ff5ba27 (make lineno_width() from blame reusable for others,
> 2012-02-12), hence why it wasn't already used here.
Thanks.

I was wondering why the decimal_width() helper is in pager.c in the first place, as there is no logical reason to tie it to the pager infrastructure.

Previous: Taylor Blau
Message 3 of 3 in “log-tree: use decimal_width()”
  1. log-tree: use decimal_width()René Scharfe, Aug 3, 2024
  2. Taylor BlauAug 4, 2024
  3. Junio C HamanoAug 5, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.