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

[PATCH/RFC] gitweb: allow configurations that change with each request

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 31, 2010, 03:01 UTC
Message-ID
<20100731030159.GD906@burratino>
In-Reply-To
<201007261623.05850.jnareb@gmail.com>
gitolite's contrib/gitweb/gitweb.conf includes:
	$ENV{GL_USER} = $cgi->remote_user || "gitweb";

which is useful for setups where a user has to be authenticated to access certain repos. Perhaps other typical configurations change per session in other ways, too.

v1.7.2-rc2~6 (gitweb: Move evaluate_gitweb_config out of run_request, 2010-07-05) broke such configurations for a speedup, by loading the configuration once per FastCGI process.

Probably in the end there should be a way to specify in the configuration whether a particular installation wants the speedup or the flexibility. But for now it is easier to just undo the relevant change.

This partially reverts commit 869d58813b24c74e84c9388041eafcef40cb51e4.
Reported-by: Julio Lajara <julio.lajara@alum.rpi.edu>
Analysis-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Jakub Narebski wrote:
Show 5 quoted lines
> I wonder if it would be possible to 
> re-enable this feature (which I think is needed to be able to use
> $cgi->remote_user) but without having all pay the [slight] performance
> penalty of including (and I think parsing) config file once per each
> request.
I dunno.  Maybe this would be a good place to start.
 gitweb/gitweb.perl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e0e9532..300c4b1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1060,8 +1060,12 @@ sub run_request {
 	reset_timer();
 
 	evaluate_uri();
+	evaluate_gitweb_config();
 	check_loadavg();
 
+	# $projectroot and $projects_list might be set in gitweb config file
+	$projects_list ||= $projectroot;
+
 	evaluate_query_params();
 	evaluate_path_info();
 	evaluate_and_validate_params();
@@ -1109,12 +1113,8 @@ sub evaluate_argv {
 
 sub run {
 	evaluate_argv();
-	evaluate_gitweb_config();
 	evaluate_git_version();
 
-	# $projectroot and $projects_list might be set in gitweb config file
-	$projects_list ||= $projectroot;
-
 	$pre_listen_hook->()
 		if $pre_listen_hook;
 
-- 
1.7.2.1.544.ga752d.dirty
Previous: Jakub NarebskiNext: Jakub Narebski
Message 9 of 15 in “Potential bug in gitweb 1.7.2”
  1. Julio LajaraJul 26, 2010
  2. Jonathan NiederJul 26, 2010
  3. Anders KaseorgJul 26, 2010
  4. Julio LajaraJul 26, 2010
  5. Jakub NarebskiJul 26, 2010
  6. Ævar Arnfjörð BjarmasonJul 26, 2010
  7. Julio LajaraJul 26, 2010
  8. Jakub NarebskiJul 26, 2010
  9. gitweb: allow configurations that change with each requestJonathan Nieder, Jul 31, 2010
  10. Jakub NarebskiAug 2, 2010
  11. Jonathan NiederAug 2, 2010
  12. Jakub NarebskiAug 2, 2010
  13. Jonathan NiederJul 26, 2010
  14. Anders KaseorgJul 26, 2010
  15. Jonathan NiederJul 27, 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.