From: Junio C Hamano <gitster@pobox.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org, Drew Northup <drew.northup@maine.edu>,
John 'Warthog9' Hawley <warthog9@kernel.org>,
Petr Baudis <pasky@suse.cz>
Subject: Re: [PATCHv3 2/2 (version B)] gitweb: Use /etc/gitweb.conf even if gitweb_conf.perl exist
Date: Wed, 25 May 2011 11:54:13 -0700 [thread overview]
Message-ID: <7v8vtu4nmy.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1306341328-11108-4-git-send-email-jnareb@gmail.com> (Jakub Narebski's message of "Wed, 25 May 2011 18:35:28 +0200")
Jakub Narebski <jnareb@gmail.com> writes:
> This commit should be thought as exclusive to
>
> [PATCH 2/2 (version A)] gitweb: Mention read_config_file in gitweb/README
>
> We have to choose one or the other.
Who says? We do not have to. Why not do this instead?
our $GITWEB_CONFIG_COMMON = $ENV{'GITWEB_CONFIG_COMMON'} ||
"/etc/gitweb-common.conf";
# common system-wide settings for convenience
read_config_file($GITWEB_COMMON);
# as always, use the per-instance GITWEB_CONFIG if exists,
# otherwise use GITWEB_SYSTEM_CONFIG
read_config_file($GITWEB_CONFIG) ||
read_config_file($GITWEB_CONFIG_SYSTEM);
There is no risk of hurting any existing installations, and people who do
have things that needs to be shared do not have to go around and update
all the per-instance configuration files.
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index ce92d67..e4b0932 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -656,9 +656,10 @@ sub evaluate_gitweb_config {
> our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
> our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
>
> - # use first config file that exists
> - read_config_file($GITWEB_CONFIG) or
> + # let settings in second override ones in first
> read_config_file($GITWEB_CONFIG_SYSTEM);
> + read_config_file($GITWEB_CONFIG)
> + if ($GITWEB_CONFIG ne $GITWEB_CONFIG_SYSTEM);
> }
>
> # Get loadavg of system, to compare against $maxload.
next prev parent reply other threads:[~2011-05-25 18:54 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 ` [PATCHv1 2/2 (version A)] gitweb: Mention read_config_file in gitweb/README Jakub Narebski
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 [this message]
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=7v8vtu4nmy.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=drew.northup@maine.edu \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.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).