@@ -177,13 +177,15 @@ not include variables usually directly set during build):
177177 * $my_url, $my_uri
178178 Full URL and absolute URL of gitweb script;
179179 in earlier versions of gitweb you might have need to set those
180- variables, now there should be no need to do it.
180+ variables, now there should be no need to do it. See
181+ $per_request_config if you need to set them still.
181182 * $base_url
182183 Base URL for relative URLs in pages generated by gitweb,
183184 (e.g. $logo, $favicon, @stylesheets if they are relative URLs),
184185 needed and used only for URLs with nonempty PATH_INFO via
185186 <base href="$base_url">. Usually gitweb sets its value correctly,
186187 and there is no need to set this variable, e.g. to $my_uri or "/".
188+ See $per_request_config if you need to set it anyway.
187189 * $home_link
188190 Target of the home link on top of all pages (the first part of view
189191 "breadcrumbs"). By default set to absolute URI of a page ($my_uri).
@@ -246,6 +248,16 @@ not include variables usually directly set during build):
246248 http://www.andre-simon.de due to assumptions about parameters and output).
247249 Useful if highlight is not installed on your webserver's PATH.
248250 [Default: highlight]
251+ * $per_request_config
252+ If set to code reference, it would be run once per each request. You can
253+ set parts of configuration that change per session, e.g. by setting it to
254+ sub { $ENV{GL_USER} = $cgi->remote_user || "gitweb"; }
255+ Otherwise it is treated as boolean value: if true gitweb would process
256+ config file once per request, if false it would process config file only
257+ once. Note: $my_url, $my_uri, and $base_url are overwritten with
258+ their default values before every request, so if you want to change
259+ them, be sure to set this variable to true or a code reference effecting
260+ the desired changes. The default is true.
249261
250262Projects list file format
251263~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments