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

Re: [RFC/PATCH] gitweb: Enable transparent compression form HTTP output

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 27, 2007, 11:01 UTC
Message-ID
<200708271301.06451.jnareb@gmail.com>
In-Reply-To
<20070825221445.GD1219@pasky.or.cz>
On Sunday, 26 August 2007, Petr "Pasky" Baudis wrote:
Show 12 quoted lines
> On Sun, Aug 26, 2007 at 12:09:29AM CEST, Jakub Narebski wrote:
>> On Sat, Aug 25, 2007, Petr Baudis wrote:
>>> On Wed, Jul 25, 2007 at 08:39:43PM CEST, Jakub Narebski wrote:
>>> 
>>>> Check if PerlIO::gzip is available, and if it is make it possible to
>>> 
>>> It doesn't really check if the require succeeded. Either the description
>>> or (preferrably, but not a showstopper, IMO) the code should be
>>> adjusted.
>> 
>> It does not check if require succeeded (I could do that this way),
>> but instead checks if $PerlIO::gzip::VERSION is defined (if it is true).
See below for alternate solution.
Show 5 quoted lines
>> our $enable_transparent_compression = !! $PerlIO::gzip::VERSION;
> 
> Whoops, I completely missed this chunk.
> 
>  Bareword "PerlIO::gzip::VERSION" not allowed while "strict subs" in use at /home/pasky/WWW/repo/gitweb.cgi line 26.
Did you perchance forgot '$' in "$PerlIO::gzip::VERSION"?
But I agree that using
	BEGIN {
        	CGI->compile() if $ENV{'MOD_PERL'};
	        eval { require PerlIO::gzip; }; # needed for transparent compression
		our $enable_transparent_compression = ! $@;
	}
 
instead of
	BEGIN {
        	CGI->compile() if $ENV{'MOD_PERL'};
	        eval { require PerlIO::gzip; }; # needed for transparent compression
	}
 
	our $enable_transparent_compression = !! $PerlIO::gzip::VERSION;
 
is more sensible. I have tried to check the above code for the case when
PerlIO::gzip is not available by using non-existent module "PerlIO::gzp"
in eval, and non-existent variable "$PerlIO::gip::VERSION" in the
definition of $enable_transparent_compression variable, and Perl doesn't
give any errors nor warnings while running gitweb.

But what it is a bit strange, when I have chosen different name for a variable to test, "$PerlIO::gzip::VERSON" (existing but not loaded module, non-existent name), I have got the following strange warning:

  gitweb.perl: Name "PerlIO::gzip::VERSON" used only once: possible typo
  at /home/jnareb/git/t/trash/../../gitweb/gitweb.perl line 27.
Strange...
-- 
Jakub Narebski
Poland
Previous: Petr BaudisNext: Jakub Narebski
Message 19 of 35 in “gitweb: snapshot cleanups & support for offering multiple formats”
  1. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jun 28, 2007
  2. Junio C HamanoJul 7, 2007
  3. Junio C HamanoJul 8, 2007
  4. Jakub NarebskiJul 11, 2007
  5. Junio C HamanoJul 11, 2007
  6. Matt McCutchenJul 12, 2007
  7. Jakub NarebskiJul 12, 2007
  8. Matt McCutchenJul 17, 2007
  9. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jul 17, 2007
  10. Jakub NarebskiJul 18, 2007
  11. Junio C HamanoJul 19, 2007
  12. Luben TuikovJul 19, 2007
  13. Jakub NarebskiJul 19, 2007
  14. Luben TuikovJul 19, 2007
  15. gitweb: Enable transparent compression form HTTP outputJakub Narebski, Jul 25, 2007
  16. Petr BaudisAug 25, 2007
  17. Jakub NarebskiAug 25, 2007
  18. Petr BaudisAug 25, 2007
  19. Jakub NarebskiAug 27, 2007
  20. Jakub NarebskiJul 19, 2007
  21. Junio C HamanoJul 20, 2007
  22. Jakub NarebskiJul 19, 2007
  23. gitweb: snapshot cleanups & support for offering multiple formatsJakub Narebski, Jul 21, 2007
  24. Junio C HamanoJul 22, 2007
  25. Matt McCutchenJul 22, 2007
  26. gitweb: Fix support for legacy gitweb config for snapshotsJakub Narebski, Jul 22, 2007
  27. Matt McCutchenJul 22, 2007
  28. Junio C HamanoJul 22, 2007
  29. Junio C HamanoJul 8, 2007
  30. Matt McCutchenJul 9, 2007
  31. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jul 9, 2007
  32. Jakub NarebskiJul 10, 2007
  33. Junio C HamanoJul 9, 2007
  34. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jul 10, 2007
  35. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jul 10, 2007

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.