@matheusbsbs / matheus-bagliano / commits / 52c813f22f
Fork 0

gitweb: Add example of config file and how to generate projects list to gitweb/INSTALL

Add simple example of config file (turning on and allowing override of a few %features). Also example config file and script to generate list of projects in a format that can be used as GITWEB_LIST / $projects_list. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Mar 26, 2007 at 02:34 UTC 52c813f22fef784c0c66fb3cb18217489cbacf3a
1 file changed +43 -2
gitweb/INSTALL
+43 -2
@@ -103,9 +103,25 @@ for gitweb (in gitweb/README).
103
104 See the top of gitweb.perl file for examples of customizable options.
105
106 +Config file example
107 +~~~~~~~~~~~~~~~~~~~
108
107 -Gitweb repositories:
108 ---------------------
109 +To enable blame, pickaxe search, and snapshot support, while allowing
110 +individual projects to turn them off, put the following in your
111 +GITWEB_CONFIG file:
112 +
113 + $feature{'blame'}{'default'} = [1];
114 + $feature{'blame'}{'override'} = 1;
115 +
116 + $feature{'pickaxe'}{'default'} = [1];
117 + $feature{'pickaxe'}{'override'} = 1;
118 +
119 + $feature{'snapshot'}{'default'} = ['x-gzip', 'gz', 'gzip'];
120 + $feature{'snapshot'}{'override'} = 1;
121 +
122 +
123 +Gitweb repositories
124 +-------------------
125
126 - By default all git repositories under projectroot are visible and
127 available to gitweb. List of projects is generated by default by
@@ -139,6 +155,31 @@ Gitweb repositories:
155 show repository only if this file exists in its object database
156 (if directory has the magic file $export_ok).
157
158 +Generating projects list using gitweb
159 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160 +
161 +We assume that GITWEB_CONFIG has its default Makefile value, namely
162 +gitweb_config.perl. Put the following in gitweb_make_index.perl file:
163 +
164 + $GITWEB_CONFIG = "gitweb_config.perl";
165 + do $GITWEB_CONFIG if -e $GITWEB_CONFIG;
166 +
167 + $projects_list = $projectroot;
168 +
169 +Then create the following script to get list of project in the format
170 +suitable for GITWEB_LIST build configuration variable (or
171 +$projects_list variable in gitweb config):
172 +
173 + #!/bin/sh
174 +
175 + export GITWEB_CONFIG="gitweb_make_index.perl"
176 + export GATEWAY_INTERFACE="CGI/1.1"
177 + export HTTP_ACCEPT="*/*"
178 + export REQUEST_METHOD="GET"
179 + export QUERY_STRING="a=project_index"
180 +
181 + perl -- /var/www/cgi-bin/gitweb.cgi
182 +
183
184 Requirements
185 ------------