@matheusbsbs / matheus-bagliano / commits / 7f425db914
Fork 0

gitweb: allow configurations that change with each request

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> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Jul 30, 2010 at 22:01 UTC 7f425db9146b7ec8c67edfd8b49218cc110151ed
1 file changed +4 -4
gitweb/gitweb.perl
+4 -4
@@ -1037,8 +1037,12 @@ sub run_request {
1037 reset_timer();
1038
1039 evaluate_uri();
1040 + evaluate_gitweb_config();
1041 check_loadavg();
1042
1043 + # $projectroot and $projects_list might be set in gitweb config file
1044 + $projects_list ||= $projectroot;
1045 +
1046 evaluate_query_params();
1047 evaluate_path_info();
1048 evaluate_and_validate_params();
@@ -1086,12 +1090,8 @@ sub evaluate_argv {
1090
1091 sub run {
1092 evaluate_argv();
1089 - evaluate_gitweb_config();
1093 evaluate_git_version();
1094
1092 - # $projectroot and $projects_list might be set in gitweb config file
1093 - $projects_list ||= $projectroot;
1094 -
1095 $pre_listen_hook->()
1096 if $pre_listen_hook;
1097