git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv1 2/2 (version A)] gitweb: Mention read_config_file in gitweb/README

From
Jakub Narebski <jnareb@gmail.com>
Date
May 25, 2011, 16:35 UTC
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 <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
Previous: Junio C HamanoNext: Jakub Narebski
Message 4 of 9 in “gitweb: Improve handling of configuration files”
  1. 0/2 gitweb: Improve handling of configuration filesJakub Narebski, May 25, 2011
  2. 1/2 gitweb: Refactor reading and parsing config file into read_config_fileJakub Narebski, May 25, 2011
  3. Junio C HamanoMay 25, 2011
  4. 2/2 gitweb: Mention read_config_file in gitweb/READMEJakub Narebski, May 25, 2011
  5. 2/2 gitweb: Use /etc/gitweb.conf even if gitweb_conf.perl existJakub Narebski, May 25, 2011
  6. Junio C HamanoMay 25, 2011
  7. 2/2 gitweb: Introduce common system-wide settings for convenienceJakub Narebski, May 26, 2011
  8. J.H.May 25, 2011
  9. Junio C HamanoMay 25, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.