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

Re: [PATCH] gitweb: Die if there are parsing errors in config file

From
JJ.H. <warthog19@eaglescrag.net>
Date
Feb 7, 2010, 10:53 UTC
Message-ID
<4B6E9BBB.4000904@eaglescrag.net>
In-Reply-To
<20100207093744.29846.6468.stgit@localhost.localdomain>
I'd sign-off that, I've probably run into it a couple of times myself.
- John 'Warthog9' Hawley
On 02/07/2010 01:40 AM, Jakub Narebski wrote:
Show 35 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>
> ---
> 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;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 6 in “gitweb: Die if there are parsing errors in config file”
  1. gitweb: Die if there are parsing errors in config fileJakub Narebski, Feb 7, 2010
  2. J.H.Feb 7, 2010
  3. Jakub NarebskiFeb 8, 2010
  4. Jakub NarebskiFeb 13, 2010
  5. Junio C HamanoFeb 14, 2010
  6. Jakub NarebskiFeb 14, 2010

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.