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
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 30, 2009, 17:12 UTC
Message-ID
<alpine.DEB.1.00.0901301811180.3586@pacific.mpi-cbg.de>
In-Reply-To
<1233308489-2656-2-git-send-email-geofft@mit.edu>
Hi,
On Fri, 30 Jan 2009, Geoffrey Thomas wrote:
Show 6 quoted lines
> From: Geoffrey Thomas <geofft@mit.edu>
> git blame misaligns output if a author's name has a differing display width and
> strlen; for instance, an accented Latin letter that takes two bytes to encode
> will cause the rest of the line to be shifted to the left by one. To fix this,
> use utf8_strwidth instead of strlen (and compute the padding ourselves, since
> printf doesn't know about UTF-8).

Good point (even if your commit message has lines much longer than 72 chars, ASCII ones at that).

But how certain are you at that point that the authors are in UTF-8 format? IOW what encoding conversions were possibly performed up to that point?

You might want to make it easier on possible reviewers by putting that discussion into the commit message.

Ciao, Dscho

Previous: Geoffrey ThomasNext: Geoffrey Thomas
Message 3 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.