From: Jakub Narebski Date: Wed, 25 May 2011 16:35:27 GMT Subject: [PATCHv1 2/2 (version A)] gitweb: Mention read_config_file in gitweb/README Message-ID: <1306341328-11108-3-git-send-email-jnareb@gmail.com> In-Reply-To: <1306341328-11108-1-git-send-email-jnareb@gmail.com> Using read_config_file($GITWEB_CONFIG_SYSTEM); at the very beginning of per-instance GITWEB_CONFIG file is quite similar to e.g. using if [ -f /etc/bashrc ]; then . /etc/bashrc fi in ~/.bashrc to read system-wide defaults. This solution is backwards compatibile, but it requires to explicitly request system-wide defaults... which otherwise are _not used at all_ when per-instance config file exists. Suggested-by: Junio C Hamano Signed-off-by: Jakub Narebski --- This is alternate solution to "system-wide policy" problem, the other way to make things convenient. It was (soft of) suggested by Junio in Re: [PATCHv2] gitweb: Use GITWEB_CONFIG_SYSTEM even if GITWEB_CONFIG does exist http://thread.gmane.org/gmane.comp.version-control.git/173603/focus=173815 While usually user's (here per-instance) configuration file overrides system-wide configuration file settings (or in other words first obtained value from user's and system-wide configuration file, in that order, is used), like e.g. the case for ssh_config,... it is not universal, as described in commit message. This commit should be thought as exclusive to [PATCH 2/2 (version B)] gitweb: Use /etc/gitweb.conf even if gitweb_conf.perl exist We have to choose one or the other. Note that this other version includes also change to gitweb/INSTALL... gitweb/README | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/gitweb/README b/gitweb/README index a92bde7..ea10c91 100644 --- a/gitweb/README +++ b/gitweb/README @@ -127,6 +127,16 @@ Runtime gitweb configuration You can adjust gitweb behaviour using the file specified in `GITWEB_CONFIG` (defaults to 'gitweb_config.perl' in the same directory as the CGI), and as a fallback `GITWEB_CONFIG_SYSTEM` (defaults to /etc/gitweb.conf). +You can read defaults in system-wide GITWEB_CONFIG_SYSTEM from GITWEB_CONFIG +by adding + + read_config_file($GITWEB_CONFIG_SYSTEM); + +at very beginning of per-instance GITWEB_CONFIG file. In this case +settings in said per-instance file will override settings from +system-wide configuration file. Note that read_config_file checks +itself that the $GITWEB_CONFIG_SYSTEM file exists. + The most notable thing that is not configurable at compile time are the optional features, stored in the '%features' variable. -- 1.7.5