Merge branch 'maint'
[gitweb.git] / gitweb / INSTALL
index 371407dc230e7bafea29276ce72c41c355ce2b59..743f2d4442b48af3627c1117aaaf73c89da306be 100644 (file)
@@ -95,7 +95,11 @@ for gitweb (in gitweb/README).
   by default it is file named gitweb_config.perl in the same place as
   gitweb.cgi script. You can control default place for config file
   using GITWEB_CONFIG build configuration variable, and you can set it
-  using GITWEB_CONFIG environmental variable.
+  using GITWEB_CONFIG environmental variable. If this file does not
+  exist, gitweb looks for a system-wide configuration file, normally
+  /etc/gitweb.conf. You can change the default using the
+  GITWEB_CONFIG_SYSTEM build configuration variable, and override it
+  through GITWEB_CONFIG_SYSTEM environmental variable.
 
 - Gitweb config file is [fragment] of perl code. You can set variables
   using "our $variable = value"; text from "#" character until the end
@@ -103,9 +107,25 @@ for gitweb (in gitweb/README).
 
   See the top of gitweb.perl file for examples of customizable options.
 
+Config file example
+~~~~~~~~~~~~~~~~~~~
 
-Gitweb repositories:
---------------------
+To enable blame, pickaxe search, and snapshot support, while allowing
+individual projects to turn them off, put the following in your
+GITWEB_CONFIG file:
+
+       $feature{'blame'}{'default'} = [1];
+       $feature{'blame'}{'override'} = 1;
+
+       $feature{'pickaxe'}{'default'} = [1];
+       $feature{'pickaxe'}{'override'} = 1;
+
+       $feature{'snapshot'}{'default'} = ['zip', 'tgz'];
+       $feature{'snapshot'}{'override'} = 1;
+
+
+Gitweb repositories
+-------------------
 
 - By default all git repositories under projectroot are visible and
   available to gitweb. List of projects is generated by default by
@@ -139,6 +159,31 @@ Gitweb repositories:
   show repository only if this file exists in its object database
   (if directory has the magic file $export_ok).
 
+Generating projects list using gitweb
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We assume that GITWEB_CONFIG has its default Makefile value, namely
+gitweb_config.perl. Put the following in gitweb_make_index.perl file:
+
+       $GITWEB_CONFIG = "gitweb_config.perl";
+       do $GITWEB_CONFIG if -e $GITWEB_CONFIG;
+
+       $projects_list = $projectroot;
+
+Then create the following script to get list of project in the format
+suitable for GITWEB_LIST build configuration variable (or
+$projects_list variable in gitweb config):
+
+       #!/bin/sh
+
+       export GITWEB_CONFIG="gitweb_make_index.perl"
+       export GATEWAY_INTERFACE="CGI/1.1"
+       export HTTP_ACCEPT="*/*"
+       export REQUEST_METHOD="GET"
+       export QUERY_STRING="a=project_index"
+
+       perl -- /var/www/cgi-bin/gitweb.cgi
+
 
 Requirements
 ------------