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

Re: [PATCHv2] gitweb: selectable configurations that change with each request

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 25, 2010, 18:23 UTC
Message-ID
<20101125182314.GA17261@burratino>
In-Reply-To
<201011251318.31235.jnareb@gmail.com>
Jakub Narebski wrote:
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
[...]
Show 21 quoted lines
> @@ -1068,12 +1076,21 @@ sub reset_timer {
>  	our $number_of_git_cmds = 0;
>  }
>  
> +our $first_request = 1;
>  sub run_request {
>  	reset_timer();
>  
>  	evaluate_uri();
> -	evaluate_gitweb_config();
> -	evaluate_git_version();
> +	if ($first_request) {
> +		evaluate_gitweb_config();
> +		evaluate_git_version();
> +	} elsif ($per_request_config) {
> +		if (ref($per_request_config) eq 'CODE') {
> +			$per_request_config->();
> +		} else {
> +			evaluate_gitweb_config();
> +		}
> +	}
Should per_request_config() be run for the first request, too?  Maybe:
	if ($first_request) {
		evaluate_gitweb_config();
		evaluate_git_version();
	}
	if ($per_request_config) {
		if (ref($per_request_config) eq 'CODE') {
			$per_request_config->();
		} elsif (!$first_request) {
			evaluate_gitweb_config();
		}
	}
Previous: Jakub NarebskiNext: Jakub Narebski
Message 6 of 7 in “gitweb: selectable configurations that change with each request”
  1. gitweb: selectable configurations that change with each requestJakub Narebski, Nov 11, 2010
  2. Jonathan NiederNov 11, 2010
  3. Junio C HamanoNov 24, 2010
  4. Jakub NarebskiNov 24, 2010
  5. [PATCHv2] gitweb: selectable configurations that change with each requestJakub Narebski, Nov 25, 2010
  6. Jonathan NiederNov 25, 2010
  7. [PATCHv3] gitweb: selectable configurations that change with each requestJakub Narebski, Nov 25, 2010

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.