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

Re: The gitweb author initials feature from a36817b doesn't work with i18n names

From
Jakub Narębski <jnareb@gmail.com>
Date
Aug 29, 2013, 14:44 UTC
Message-ID
<CANQwDwcyV7N6xPxaYFUnRQptVabwkd_mFconZPGDm9iGS3LArA@mail.gmail.com>
In-Reply-To
<CACBZZX4i-Tu1G07e9=5DYFjY9EtRGO8gLJf71d5aLeaE-cj-8w@mail.gmail.com>
[Ævar, sorry for duplication but I accidentally send HTML email; stupid Gmail]

On Thu, Aug 29, 2013 at 4:26 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 5 quoted lines
> The @author_initials feature Jakub added in a36817b claims to use a
> i18n regexp (/\b([[:upper:]])\B/g), but in Perl this doesn't actually
> do anything unless the string being matched against has the UTF8 flag.
>
> So as a result it abbreviates me to "AB" not "ÆAB".
[...]
Thanks for catching this, and for an analysis.
Show 17 quoted lines
> Jakub, do you see a reason not to just apply this:
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index f429f75..29b3fb5 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -6631,6 +6631,7 @@ sub git_blame_common {
>                         $hash_base, '--', $file_name
>                         or die_error(500, "Open git-blame --porcelain failed");
>         }
> +       binmode $fd, ":utf8";
>
>         # incremental blame data returns early
>         if ($format eq 'data') {
>
> I haven't gotten an env where I can test gitweb running, but that
> looks like it should work to me.

Unfortunetly I cannot check this either, but it looks obviously correct. ACK.

-- 
Jakub Narebski
Previous: Ævar Arnfjörð BjarmasonNext: Simon Ruderich
Message 2 of 11 in “The gitweb author initials feature from a36817b doesn't work with i18n names”
  1. Ævar Arnfjörð BjarmasonAug 29, 2013
  2. Jakub NarębskiAug 29, 2013
  3. Simon RuderichAug 29, 2013
  4. gitweb: Fix the author initials in blame for non-ASCII namesÆvar Arnfjörð Bjarmason, Aug 30, 2013
  5. Junio C HamanoAug 30, 2013
  6. Jakub NarębskiAug 30, 2013
  7. Junio C HamanoAug 30, 2013
  8. Simon RuderichAug 30, 2013
  9. Kyle J. McKayAug 30, 2013
  10. Jakub NarębskiAug 31, 2013
  11. Ævar Arnfjörð BjarmasonAug 31, 2013

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.