@matheusbsbs / matheus-bagliano / commits / 45a3b12cfd
Fork 0

gitweb: Document features better

This expands gitweb/README to talk some more about GITWEB_CONFIG, moves feature-specific documentation in gitweb.cgi to the inside of the %features array, and adds some short description of all the features. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>

Petr Baudis committed Oct 7, 2006 at 15:17 UTC 45a3b12cfd3eaa05bbb0954790d5be5b8240a7b5
2 files changed +56 -19
gitweb/README
+15 -1
@@ -24,11 +24,25 @@ You can specify the following configuration variables when building GIT:
24 * GITWEB_LOGO
25 Points to the location where you put git-logo.png on your web server.
26 * GITWEB_CONFIG
27 - This file will be loaded using 'require'. If the environment
27 + This file will be loaded using 'require' and can be used to override any
28 + of the options above as well as some other options - see the top of
29 + 'gitweb.cgi' for their full list and description. If the environment
30 $GITWEB_CONFIG is set when gitweb.cgi is executed the file in the
31 environment variable will be loaded instead of the file
32 specified when gitweb.cgi was created.
33
34 +Runtime gitweb configuration
35 +----------------------------
36 +
37 +You can adjust gitweb behaviour using the file specified in `GITWEB_CONFIG`
38 +(defaults to 'gitweb_config.perl' in the same directory as the CGI).
39 +See the top of 'gitweb.cgi' for the list of variables and some description.
40 +The most notable thing that is not configurable at compile time are the
41 +optional features, stored in the '%features' variable. You can find further
42 +description on how to reconfigure the default features setting in your
43 +`GITWEB_CONFIG` or per-project in `project.git/config` inside 'gitweb.cgi'.
44 +
45 +
46 Originally written by:
47 Kay Sievers <kay.sievers@vrfy.org>
48
gitweb/gitweb.perl
+41 -18
@@ -87,22 +87,63 @@ our %feature = (
87 #
88 # use gitweb_check_feature(<feature>) to check if <feature> is enabled
89
90 + # Enable the 'blame' blob view, showing the last commit that modified
91 + # each line in the file. This can be very CPU-intensive.
92 +
93 + # To enable system wide have in $GITWEB_CONFIG
94 + # $feature{'blame'}{'default'} = [1];
95 + # To have project specific config enable override in $GITWEB_CONFIG
96 + # $feature{'blame'}{'override'} = 1;
97 + # and in project config gitweb.blame = 0|1;
98 'blame' => {
99 'sub' => \&feature_blame,
100 'override' => 0,
101 'default' => [0]},
102
103 + # Enable the 'snapshot' link, providing a compressed tarball of any
104 + # tree. This can potentially generate high traffic if you have large
105 + # project.
106 +
107 + # To disable system wide have in $GITWEB_CONFIG
108 + # $feature{'snapshot'}{'default'} = [undef];
109 + # To have project specific config enable override in $GITWEB_CONFIG
110 + # $feature{'blame'}{'override'} = 1;
111 + # and in project config gitweb.snapshot = none|gzip|bzip2;
112 'snapshot' => {
113 'sub' => \&feature_snapshot,
114 'override' => 0,
115 # => [content-encoding, suffix, program]
116 'default' => ['x-gzip', 'gz', 'gzip']},
117
118 + # Enable the pickaxe search, which will list the commits that modified
119 + # a given string in a file. This can be practical and quite faster
120 + # alternative to 'blame', but still potentially CPU-intensive.
121 +
122 + # To enable system wide have in $GITWEB_CONFIG
123 + # $feature{'pickaxe'}{'default'} = [1];
124 + # To have project specific config enable override in $GITWEB_CONFIG
125 + # $feature{'pickaxe'}{'override'} = 1;
126 + # and in project config gitweb.pickaxe = 0|1;
127 'pickaxe' => {
128 'sub' => \&feature_pickaxe,
129 'override' => 0,
130 'default' => [1]},
131
132 + # Make gitweb use an alternative format of the URLs which can be
133 + # more readable and natural-looking: project name is embedded
134 + # directly in the path and the query string contains other
135 + # auxiliary information. All gitweb installations recognize
136 + # URL in either format; this configures in which formats gitweb
137 + # generates links.
138 +
139 + # To enable system wide have in $GITWEB_CONFIG
140 + # $feature{'pathinfo'}{'default'} = [1];
141 + # Project specific override is not supported.
142 +
143 + # Note that you will need to change the default location of CSS,
144 + # favicon, logo and possibly other files to an absolute URL. Also,
145 + # if gitweb.cgi serves as your indexfile, you will need to force
146 + # $my_uri to contain the script name in your $GITWEB_CONFIG.
147 'pathinfo' => {
148 'override' => 0,
149 'default' => [0]},
@@ -123,12 +164,6 @@ sub gitweb_check_feature {
164 return $sub->(@defaults);
165 }
166
126 -# To enable system wide have in $GITWEB_CONFIG
127 -# $feature{'blame'}{'default'} = [1];
128 -# To have project specific config enable override in $GITWEB_CONFIG
129 -# $feature{'blame'}{'override'} = 1;
130 -# and in project config gitweb.blame = 0|1;
131 -
167 sub feature_blame {
168 my ($val) = git_get_project_config('blame', '--bool');
169
@@ -141,12 +176,6 @@ sub feature_blame {
176 return $_[0];
177 }
178
144 -# To disable system wide have in $GITWEB_CONFIG
145 -# $feature{'snapshot'}{'default'} = [undef];
146 -# To have project specific config enable override in $GITWEB_CONFIG
147 -# $feature{'blame'}{'override'} = 1;
148 -# and in project config gitweb.snapshot = none|gzip|bzip2
149 -
179 sub feature_snapshot {
180 my ($ctype, $suffix, $command) = @_;
181
@@ -170,12 +199,6 @@ sub gitweb_have_snapshot {
199 return $have_snapshot;
200 }
201
173 -# To enable system wide have in $GITWEB_CONFIG
174 -# $feature{'pickaxe'}{'default'} = [1];
175 -# To have project specific config enable override in $GITWEB_CONFIG
176 -# $feature{'pickaxe'}{'override'} = 1;
177 -# and in project config gitweb.pickaxe = 0|1;
178 -
202 sub feature_pickaxe {
203 my ($val) = git_get_project_config('pickaxe', '--bool');
204