git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Drew Northup <drew.northup@maine.edu>,
	John 'Warthog9' Hawley <warthog9@kernel.org>,
	Petr Baudis <pasky@suse.cz>, Jakub Narebski <jnareb@gmail.com>
Subject: [PATCHv1 2/2 (version A)] gitweb: Mention read_config_file in gitweb/README
Date: Wed, 25 May 2011 18:35:27 +0200	[thread overview]
Message-ID: <1306341328-11108-3-git-send-email-jnareb@gmail.com> (raw)
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 <gitster@pobox.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
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

  parent reply	other threads:[~2011-05-25 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 16:35 [PATCH 0/2] gitweb: Improve handling of configuration files Jakub Narebski
2011-05-25 16:35 ` [PATCH 1/2] gitweb: Refactor reading and parsing config file into read_config_file Jakub Narebski
2011-05-25 19:36   ` Junio C Hamano
2011-05-25 16:35 ` Jakub Narebski [this message]
2011-05-25 16:35 ` [PATCHv3 2/2 (version B)] gitweb: Use /etc/gitweb.conf even if gitweb_conf.perl exist Jakub Narebski
2011-05-25 18:54   ` Junio C Hamano
2011-05-26 14:58     ` [PATCH/RFC 2/2 (version C)] gitweb: Introduce common system-wide settings for convenience Jakub Narebski
2011-05-25 18:38 ` [PATCH 0/2] gitweb: Improve handling of configuration files J.H.
2011-05-25 19:34   ` Junio C Hamano

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=1306341328-11108-3-git-send-email-jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=drew.northup@maine.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pasky@suse.cz \
    --cc=warthog9@kernel.org \
    /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).