Re: [PATCH] gitweb: Fix the author initials in blame for non-ASCII names

5 messages, 5 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] gitweb: Fix the author initials in blame for non-ASCII names

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:58:34

Junio C Hamano [off-list ref] writes:
Ævar Arnfjörð Bjarmason  [off-list ref] writes:
quoted
Acked-by: Jakub Narębski <redacted>
Tested-by: Ævar Arnfjörð Bjarmason <redacted>
Tested-by: Simon Ruderich <redacted>
---
+++ b/gitweb/gitweb.perl
@@ -6631,6 +6631,7 @@ sub git_blame_common {
...
+	binmode $fh, ':utf8';
[Fri Aug 30 17:48:17 2013] gitweb.perl: Global symbol "$fh" requires
explicit package name at /home/gitster/w/buildfarm/next/t/../gitweb/gitweb.perl line 6634.
[Fri Aug 30 17:48:17 2013] gitweb.perl: Execution of /home/gitster/w/buildfarm/next/t/../gitweb/gitweb.perl aborted due to compilation errors.
I think in this function the filehandle is called $fd, not $fh.  Has
any of you really tested this???

Re: [PATCH] gitweb: Fix the author initials in blame for non-ASCII names

From: Simon Ruderich <hidden>
Date: 2016-06-15 22:58:35

On Fri, Aug 30, 2013 at 11:13:19AM -0700, Junio C Hamano wrote:
I think in this function the filehandle is called $fd, not $fh.  Has
any of you really tested this???
I did, but I applied the change by hand without applying the
patch directly and didn't notice the difference. Sorry for that.

Regards
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

Re: [PATCH] gitweb: Fix the author initials in blame for non-ASCII names

From: Kyle J. McKay <hidden>
Date: 2016-06-15 22:58:35

On Aug 30, 2013, at 11:13, Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
Ævar Arnfjörð Bjarmason  [off-list ref] writes:
quoted
Acked-by: Jakub Narębski <redacted>
Tested-by: Ævar Arnfjörð Bjarmason <redacted>
Tested-by: Simon Ruderich <redacted>
---
+++ b/gitweb/gitweb.perl
@@ -6631,6 +6631,7 @@ sub git_blame_common {
...
+	binmode $fh, ':utf8';
quoted
[Fri Aug 30 17:48:17 2013] gitweb.perl: Global symbol "$fh" requires
explicit package name at /home/gitster/w/buildfarm/next/t/../gitweb/ 
gitweb.perl line 6634.
[Fri Aug 30 17:48:17 2013] gitweb.perl: Execution of /home/gitster/ 
w/buildfarm/next/t/../gitweb/gitweb.perl aborted due to compilation  
errors.
I think in this function the filehandle is called $fd, not $fh.  Has
any of you really tested this???
What happens if the author name is written in ISO-8859-1 instead of  
UTF-8 in the actual commit object itself?

I'm pretty sure I've seen this where older commits have a ISO-8859-1  
author name and then newer commits have a UTF-8 version of the same  
author's name.

In fact, in the git repository itself, look at commit 0cb3f80d (UTF-8)  
and commit 7eb93c89 (ISO-8859-1) to see this in action.

Re: [PATCH] gitweb: Fix the author initials in blame for non-ASCII names

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:58:35

I did. I just clumsily sent out the wrong patch. I.e. tested it
manually on another system, and then fat-fingered $fh instead of $fd.

Should I send another patch or do you want to just fix this one up?

On Fri, Aug 30, 2013 at 8:13 PM, Junio C Hamano [off-list ref] wrote:
Junio C Hamano [off-list ref] writes:
quoted
Ævar Arnfjörð Bjarmason  [off-list ref] writes:
quoted
Acked-by: Jakub Narębski <redacted>
Tested-by: Ævar Arnfjörð Bjarmason <redacted>
Tested-by: Simon Ruderich <redacted>
---
+++ b/gitweb/gitweb.perl
@@ -6631,6 +6631,7 @@ sub git_blame_common {
...
+    binmode $fh, ':utf8';
quoted
[Fri Aug 30 17:48:17 2013] gitweb.perl: Global symbol "$fh" requires
explicit package name at /home/gitster/w/buildfarm/next/t/../gitweb/gitweb.perl line 6634.
[Fri Aug 30 17:48:17 2013] gitweb.perl: Execution of /home/gitster/w/buildfarm/next/t/../gitweb/gitweb.perl aborted due to compilation errors.
I think in this function the filehandle is called $fd, not $fh.  Has
any of you really tested this???

Re: [PATCH] gitweb: Fix the author initials in blame for non-ASCII names

From: Jakub Narębski <hidden>
Date: 2016-06-15 22:58:35

On Fri, Aug 30, 2013 at 11:39 PM, Kyle J. McKay [off-list ref] wrote:
On Aug 30, 2013, at 11:13, Junio C Hamano wrote:
quoted
Junio C Hamano [off-list ref] writes:
quoted
Ævar Arnfjörð Bjarmason  [off-list ref] writes:
quoted
quoted
quoted
+       binmode $fh, ':utf8';
What happens if the author name is written in ISO-8859-1 instead of UTF-8 in
the actual commit object itself?

I'm pretty sure I've seen this where older commits have a ISO-8859-1 author
name and then newer commits have a UTF-8 version of the same author's name.

In fact, in the git repository itself, look at commit 0cb3f80d (UTF-8) and
commit 7eb93c89 (ISO-8859-1) to see this in action.
Well, then you have a problem, though it is only with old history (before
introduction of "encoding" header in commit object).

Better and more complete solution would be to use to_utf8() function
instead of 'utf8' layer, which when finding invalid UTF-8 sequence uses
$fallback_encoding (by default "latin1", i.e. ISO-8859-1) instead.


In my TODO list is creating PerlIO layer ':utf8-with-fallback' which would
replace all those to_utf8() calls...

-- 
Jakub Narebski
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help