git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Han-Wen Nienhuys <hanwen@xs4all.nl>
Cc: git@vger.kernel.org
Subject: [PATCH/RFC] gitweb: Add example of config file and how to generate projects list to gitweb/INSTALL
Date: Mon, 26 Mar 2007 02:34:41 +0100	[thread overview]
Message-ID: <200703260334.42885.jnareb@gmail.com> (raw)
In-Reply-To: <f329bf540703241918y22830d50jbf20928d402c67fe@mail.gmail.com>

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>
---
Han-Wen Nienhuys wrote:
> 2007/3/24, Jakub Narebski <jnareb@gmail.com>:
> > Add some installation and configuration notes for gitweb in
> > gitweb/INSTALL. Make use of filling gitweb configuration by
> > Makefile.
> >
> > It does not cover (yet?) all the configuration variables and
> > options.
> 
> I got it running with the help of the list, but this patch surely
> improves the state of the docs. Just one nit: it should give a small
> example of the desired syntax of the gitweb_conf.perl file

HTH

I'm not sure about example how to get projects list in the format
suitable for gitweb. For example HTTP headers should be stripped
from the projects_index gitweb.cgi output, but I don't remember
proper sed invocation to skip all lines up to emty line/line
containing only "\r".


 gitweb/INSTALL |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/gitweb/INSTALL b/gitweb/INSTALL
index 371407d..6328e26 100644
--- a/gitweb/INSTALL
+++ b/gitweb/INSTALL
@@ -103,9 +103,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'} = ['x-gzip', 'gz', 'gzip'];
+	$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 +155,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
 ------------
-- 
1.5.0.5

      reply	other threads:[~2007-03-26  1:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 17:52 Installation instructions for gitweb? Han-Wen Nienhuys
2007-03-22 18:11 ` Johannes Schindelin
2007-03-23 16:12 ` Frank Lichtenheld
2007-03-23 16:20   ` Han-Wen Nienhuys
2007-03-23 16:42     ` Frank Lichtenheld
2007-03-24 19:59 ` [PATCH] gitweb: Add some installation notes in gitweb/INSTALL Jakub Narebski
2007-03-25  2:18   ` Han-Wen Nienhuys
2007-03-26  1:34     ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703260334.42885.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hanwen@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).