Re: [PATCH] gitweb: Die if there are parsing errors in config file
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Feb 13, 2010, 02:46 UTC
- Message-ID
- <201002130346.51968.jnareb@gmail.com>
- In-Reply-To
- <20100207093744.29846.6468.stgit@localhost.localdomain>
Ping!
I didn't want to push for it before 1.7.0, but now that 1.7.0 is out...
On Sun, 7 Feb 2010, Jakub Narebski wrote:
Show 7 quoted lines
> Otherwise the errors can propagate, and show in damnest places, and > you would spend your time chasing ghosts instead of debugging real > problem (yes, it is from personal experience). > > This follows (parts of) advice in `perldoc -f do` documentation. > > Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: John 'Warthog9' Hawley <warthog9@kernel.org>
http://thread.gmane.org/gmane.comp.version-control.git/139226/focus=139230
Show 25 quoted lines
> ---
> This is fallout from my work on [split] "Gitweb output caching" series.
> Before I used `die $@ if $@;' in t/t9503/test_cache_interface.pl, tests
> failed for no discernable reason...
>
> So I think the same should be done for the gitweb config file.
>
> gitweb/gitweb.perl | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 1f6978a..a5bc359 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -556,6 +556,8 @@ if (-e $GITWEB_CONFIG) {
> our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
> do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM;
> }
> +# die if there are errors parsing config file
> +die $@ if $@;
>
> # Get loadavg of system, to compare against $maxload.
> # Currently it requires '/proc/loadavg' present to get loadavg;
>
> -- Jakub Narebski Poland