{"thread":{"id":"5847","subject":"[PATCH] gitweb: Document features better","startedAt":"2006-10-07T13:17:47Z","lastAt":"2006-10-07T13:35:48Z","messageCount":2,"participants":["Petr Baudis","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"28364","messageId":"20061007131746.13690.38921.stgit@rover","threadId":"5847","inReplyTo":null,"subject":"[PATCH] gitweb: Document features better","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-10-07T13:17:47Z","receivedAt":"2006-10-07T13:17:47Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"This expands gitweb/README to talk some more about GITWEB_CONFIG, moves\nfeature-specific documentation in gitweb.cgi to the inside of the %features\narray, and adds some short description of all the features.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n gitweb/README      |   16 +++++++++++++-\n gitweb/gitweb.perl |   59 ++++++++++++++++++++++++++++++++++++----------------\n 2 files changed, 56 insertions(+), 19 deletions(-)\n\ndiff --git a/gitweb/README b/gitweb/README\nindex 78e6fc0..e02e90f 100644\n--- a/gitweb/README\n+++ b/gitweb/README\n@@ -26,12 +26,26 @@ You can specify the following configurat\n  * GITWEB_LOGO\n    Points to the location where you put git-logo.png on your web server.\n  * GITWEB_CONFIG\n-   This file will be loaded using 'require'.  If the environment\n+   This file will be loaded using 'require' and can be used to override any\n+   of the options above as well as some other options - see the top of\n+   'gitweb.cgi' for their full list and description.  If the environment\n    $GITWEB_CONFIG is set when gitweb.cgi is executed the file in the\n    environment variable will be loaded instead of the file\n    specified when gitweb.cgi was created.\n \n \n+Runtime gitweb configuration\n+----------------------------\n+\n+You can adjust gitweb behaviour using the file specified in `GITWEB_CONFIG`\n+(defaults to 'gitweb_config.perl' in the same directory as the CGI).\n+See the top of 'gitweb.cgi' for the list of variables and some description.\n+The most notable thing that is not configurable at compile time are the\n+optional features, stored in the '%features' variable. You can find further\n+description on how to reconfigure the default features setting in your\n+`GITWEB_CONFIG` or per-project in `project.git/config` inside 'gitweb.cgi'.\n+\n+\n Webserver configuration\n -----------------------\n \ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex b06e96a..c4970f4 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -100,22 +100,62 @@ our %feature = (\n \t#\n \t# use gitweb_check_feature(<feature>) to check if <feature> is enabled\n \n+\t# Enable the 'blame' blob view, showing the last commit that modified\n+\t# each line in the file. This can be very CPU-intensive.\n+\n+\t# To enable system wide have in $GITWEB_CONFIG\n+\t# $feature{'blame'}{'default'} = [1];\n+\t# To have project specific config enable override in $GITWEB_CONFIG\n+\t# $feature{'blame'}{'override'} = 1;\n+\t# and in project config gitweb.blame = 0|1;\n \t'blame' => {\n \t\t'sub' => \\&feature_blame,\n \t\t'override' => 0,\n \t\t'default' => [0]},\n \n+\t# Enable the 'snapshot' link, providing a compressed tarball of any\n+\t# tree. This can potentially generate high traffic if you have large\n+\t# project.\n+\n+\t# To disable system wide have in $GITWEB_CONFIG\n+\t# $feature{'snapshot'}{'default'} = [undef];\n+\t# To have project specific config enable override in $GITWEB_CONFIG\n+\t# $feature{'blame'}{'override'} = 1;\n+\t# and in project config gitweb.snapshot = none|gzip|bzip2;\n \t'snapshot' => {\n \t\t'sub' => \\&feature_snapshot,\n \t\t'override' => 0,\n \t\t#         => [content-encoding, suffix, program]\n \t\t'default' => ['x-gzip', 'gz', 'gzip']},\n \n+\t# Enable the pickaxe search, which will list the commits that modified\n+\t# a given string in a file. This can be practical and quite faster\n+\t# alternative to 'blame', but still potentially CPU-intensive.\n+\n+\t# To enable system wide have in $GITWEB_CONFIG\n+\t# $feature{'pickaxe'}{'default'} = [1];\n+\t# To have project specific config enable override in $GITWEB_CONFIG\n+\t# $feature{'pickaxe'}{'override'} = 1;\n+\t# and in project config gitweb.pickaxe = 0|1;\n \t'pickaxe' => {\n \t\t'sub' => \\&feature_pickaxe,\n \t\t'override' => 0,\n \t\t'default' => [1]},\n \n+\t# Make gitweb use an alternative format of the URLs which can be\n+\t# more readable and natural-looking: project name and some other\n+\t# information is embedded directly in the path and the query string\n+\t# contains only auxiliary information. All gitweb installations\n+\t# support recognizing URL in both formats, this configures only\n+\t# which formats the gitweb-generated links should use.\n+\n+\t# To enable system wide have in $GITWEB_CONFIG\n+\t# $feature{'pathinfo'}{'default'} = [1];\n+\t# Project specific override is not supported.\n+\t# Note that you will need to change the default location of CSS,\n+\t# favicon, logo and possibly other files to an absolute URL. Also,\n+\t# if gitweb.cgi serves as your indexfile, you will need to force\n+\t# $my_uri to contain the script name in your $GITWEB_CONFIG.\n \t'pathinfo' => {\n \t\t'override' => 0,\n \t\t'default' => [0]},\n@@ -136,12 +176,6 @@ sub gitweb_check_feature {\n \treturn $sub->(@defaults);\n }\n \n-# To enable system wide have in $GITWEB_CONFIG\n-# $feature{'blame'}{'default'} = [1];\n-# To have project specific config enable override in $GITWEB_CONFIG\n-# $feature{'blame'}{'override'} = 1;\n-# and in project config gitweb.blame = 0|1;\n-\n sub feature_blame {\n \tmy ($val) = git_get_project_config('blame', '--bool');\n \n@@ -154,12 +188,6 @@ sub feature_blame {\n \treturn $_[0];\n }\n \n-# To disable system wide have in $GITWEB_CONFIG\n-# $feature{'snapshot'}{'default'} = [undef];\n-# To have project specific config enable override in $GITWEB_CONFIG\n-# $feature{'blame'}{'override'} = 1;\n-# and in project config  gitweb.snapshot = none|gzip|bzip2\n-\n sub feature_snapshot {\n \tmy ($ctype, $suffix, $command) = @_;\n \n@@ -183,12 +211,6 @@ sub gitweb_have_snapshot {\n \treturn $have_snapshot;\n }\n \n-# To enable system wide have in $GITWEB_CONFIG\n-# $feature{'pickaxe'}{'default'} = [1];\n-# To have project specific config enable override in $GITWEB_CONFIG\n-# $feature{'pickaxe'}{'override'} = 1;\n-# and in project config gitweb.pickaxe = 0|1;\n-\n sub feature_pickaxe {\n \tmy ($val) = git_get_project_config('pickaxe', '--bool');\n \n@@ -434,6 +456,7 @@ sub href(%) {\n \tmy ($use_pathinfo) = gitweb_check_feature('pathinfo');\n \tif ($use_pathinfo) {\n \t\t# use PATH_INFO for project name\n+\t\t# TODO: use PATH_INFO for other stuff as well\n \t\t$href .= \"/$params{'project'}\" if defined $params{'project'};\n \t\tdelete $params{'project'};\n \n"},{"id":"28366","messageId":"eg8ae2$lje$1@sea.gmane.org","threadId":"5847","inReplyTo":"20061007131746.13690.38921.stgit@rover","subject":"Re: [PATCH] gitweb: Document features better","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-07T13:35:48Z","receivedAt":"2006-10-07T13:35:48Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Petr Baudis wrote:\n\n> This expands gitweb/README to talk some more about GITWEB_CONFIG, moves\n> feature-specific documentation in gitweb.cgi to the inside of the %features\n> array, and adds some short description of all the features.\n\nThanks. Very nice.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}