git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Julio Lajara <julio.lajara@alum.rpi.edu>
Subject: Re: [PATCHv2] gitweb: selectable configurations that change with each request
Date: Thu, 25 Nov 2010 12:23:14 -0600	[thread overview]
Message-ID: <20101125182314.GA17261@burratino> (raw)
In-Reply-To: <201011251318.31235.jnareb@gmail.com>

Jakub Narebski wrote:

> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
[...]
> @@ -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();
		}
	}

  reply	other threads:[~2010-11-25 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 21:36 [PATCH/RFC] gitweb: selectable configurations that change with each request Jakub Narebski
2010-11-11 21:42 ` Jonathan Nieder
2010-11-24 17:57 ` Junio C Hamano
2010-11-24 21:43   ` Jakub Narebski
2010-11-25 12:18     ` [PATCHv2] " Jakub Narebski
2010-11-25 18:23       ` Jonathan Nieder [this message]
2010-11-25 18:43         ` [PATCHv3] " Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101125182314.GA17261@burratino \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=julio.lajara@alum.rpi.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).