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

Re: [PATCH] log --format: document %w

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 23, 2009, 00:06 UTC
Message-ID
<7vtywmayvk.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4B09CD5A.4070401@lsrfire.ath.cx>
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> I think utf8_width() is too generic for that; we shouldn't teach it terminal
> control details.

I agree that the function whose purpose is to compute display width should not be called utf8_width().

The outside caller of utf8_width() in diff.c uses it to truncate the function name hint on the hunk header line at character boundary. The input shouldn't have color escapes _we_ add (it might contain such sequences from the user data, though), so I agree that we shouldn't contaminate this function with color escapes.

> strbuf_add_wrapped_text(); ignoring display mode escape codes in there can be
> justified with its purpose.
Surely, and thanks.  The patch looks good.
Previous: René ScharfeNext: René Scharfe
Message 4 of 5 in “log --format: document %w”
  1. log --format: document %wRené Scharfe, Nov 22, 2009
  2. Junio C HamanoNov 22, 2009
  3. René ScharfeNov 22, 2009
  4. Junio C HamanoNov 23, 2009
  5. strbuf_add_wrapped_text(): skip over colour codesRené Scharfe, Nov 23, 2009

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.