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

Re: [PATCH] gitweb: Fix handling of non-ASCII characters in inserted HTML files

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 3, 2008, 10:21 UTC
Message-ID
<200812031121.43606.jnareb@gmail.com>
In-Reply-To
<7v63m1j4ke.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 10 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > Use new insert_file() subroutine to insert HTML chunks from external
> > files: $site_header, $home_text (by default indextext.html),
> > $site_footer, and $projectroot/$project/REAME.html.
> >
> > All non-ASCII chars of those files will be broken by Perl IO layer
> > without decoding to utf8, so insert_file() does to_utf8() on each
> > printed line; alternate solution would be to open those files with
> > "binmode $fh, ':utf8'", or even all files with "use open qw(:std :utf8)".
Show 22 quoted lines
> > This is more complete solution that the one provided by Tatsuki Sugiura
> > in original patch
> >
> >   [PATCH] gitweb: fix encode handling for site_{header,footer}
> >   Msg-Id: <87vdumbxgc.wl@vaj-k-334-sugi.local.valinux.co.jp>
> >   http://thread.gmane.org/gmane.comp.version-control.git/101199
> 
> It may be more complete but it is obviously untested.  Please help me
> trust you better with your future patches.  Because I personally do not
> run gitweb myself, I really need a trustworthy lieutenant(s) in the area.
> 
> [Wed Dec  3 01:52:07 2008] gitweb.perl: Global symbol "$fd" requires explicit package name at /git.git/t/../gitweb/gitweb.perl line 4500.
> [Wed Dec  3 01:52:07 2008] gitweb.perl: Execution of /git.git/t/../gitweb/gitweb.perl aborted due to compilation errors.
> 
> > but it is in principle the same solution.
> >
> > I think this one as it is a bugfix should go in git 1.6.1
> 
> Trading a gitweb with a small bug with a gitweb that does not even pass
> its test script does not feel like a good change to me.
> 
> I think the breakage is the "close $fd" at the end of this hunk:
[...]
> I'll queue it to 'pu', with the "close $fd" removed, for now.

I'm very sorry about that. It was a bit of time since my last patch sent, and I forgot that nevermind how obvious and simple the change, one should run relevant parts of test suite, or at least try to run gitweb / changed command.

With "close $fd" removed the patch is correct (and patches t9500*).
-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 9 in “gitweb: fix encode handling for site_{header,footer}”
  1. gitweb: fix encode handling for site_{header,footer}Tatsuki Sugiura, Nov 17, 2008
  2. Junio C HamanoNov 17, 2008
  3. Jakub NarebskiNov 17, 2008
  4. gitweb: Fix handling of non-ASCII characters in inserted HTML filesJakub Narebski, Dec 1, 2008
  5. Junio C HamanoDec 3, 2008
  6. Jakub NarebskiDec 3, 2008
  7. Junio C HamanoDec 3, 2008
  8. gitweb: Fix bug in insert_file() subroutineJakub Narebski, Dec 8, 2008
  9. Junio C HamanoDec 8, 2008

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.