Skip to content

Commit b3f52a9

Browse files
jrngitster
authored andcommitted
gitweb: document $per_request_config better
Global variables $my_url, $my_uri and $base_url have subtle interactions that need to be desribed, and can be influenced most cleanly by $per_request_config. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent da4b243 commit b3f52a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

gitweb/README

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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).
@@ -252,7 +254,10 @@ not include variables usually directly set during build):
252254
sub { $ENV{GL_USER} = $cgi->remote_user || "gitweb"; }
253255
Otherwise it is treated as boolean value: if true gitweb would process
254256
config file once per request, if false it would process config file only
255-
once. The default is true.
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.
256261

257262
Projects list file format
258263
~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)