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

Re: [PATCH] builtin-blame.c: Use utf8_strwidth for author's names

From
Jeff King <peff@peff.net>
Date
Jan 31, 2009, 07:24 UTC
Message-ID
<20090131072425.GD3033@coredump.intra.peff.net>
In-Reply-To
<alpine.DEB.2.00.0901301710130.1984@vinegar-pot.mit.edu>
On Fri, Jan 30, 2009 at 05:22:07PM -0500, Geoffrey Thomas wrote:
Show 5 quoted lines
> I don't believe there are any encoding conversions performed up to that  
> point. IIRC git doesn't require any encoding but encourages UTF-8; if it's 
> something obscure, I have no way of knowing how wide in screen columns the 
> author field is because I likely don't have a library for it in git at  
> all. I do have a utf8.c, though.

Don't we pull the author from the commit message after it has been converted using reencode_commit_message (see get_commit_info)? That should be respecting the log output encoding.

It looks like we just throw away the information on what we encoded _to_ (i.e., the second parameter of reencode_commit_message). Probably we need to remember that and use a generic "what is the width of this string in this encoding" function.

-Peff
Previous: Geoffrey ThomasNext: Johannes Schindelin
Message 5 of 13 in “utf8: add utf8_strwidth()”
  1. utf8: add utf8_strwidth()Geoffrey Thomas, Jan 30, 2009
  2. builtin-blame.c: Use utf8_strwidth for author's namesGeoffrey Thomas, Jan 30, 2009
  3. Johannes SchindelinJan 30, 2009
  4. Geoffrey ThomasJan 30, 2009
  5. Jeff KingJan 31, 2009
  6. Johannes SchindelinFeb 1, 2009
  7. Junio C HamanoFeb 2, 2009
  8. Johannes SchindelinFeb 2, 2009
  9. Junio C HamanoFeb 3, 2009
  10. Jeff KingFeb 2, 2009
  11. Jeff KingJan 31, 2009
  12. Geoffrey ThomasJan 31, 2009
  13. Jeff KingJan 31, 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.