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

Re: [PATCH v3] Gitweb: Use a default for a bad env config file variable

From
James Shubin <purpleidea@gmail.com>
Date
Aug 11, 2010, 13:36 UTC
Message-ID
<1281533812.28858.50.camel@ping.CS.McGill.CA>
In-Reply-To
<m3tyn22iqd.fsf@localhost.localdomain>

Thanks for all the "sending patches" input; it's useful, even if my patch isn't ;) I suppose I was trying to provide more defaults to work around some weirdly setup servers that I have inherited. Upon reconsideration, I'll withdraw the patch. Thanks for your time, and thanks for your nitpicks.

_James
-----Original Message-----
> First, why it is needed?  Why can't you just have GITWEB_CONFIG_SYSTEM
> (or GITWEB_CONFIG) environment variable visible to gitweb.cgi that
> points to existing file?

Second, is there any history behind providing this fallback only for $GITWEB_CONFIG_SYSTEM variable, and not for $GITWEB_CONFIG? Currently gitweb use environment variable if it exists, falling back to build-time value (might be default), and using first of $GITWEB_CONFIG and $GITWEB_CONFIG_SYSTEM that exists.

Show 16 quoted lines
> PS: thanks to everyone for their patience with my first patch.
> This applied cleanly with git am, let me know if I should do anything
> else differently.
> 
>  gitweb/gitweb.perl |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 4efeebc..43294e1 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -605,6 +605,10 @@ sub evaluate_gitweb_config {
>  	} elsif (-e $GITWEB_CONFIG_SYSTEM) {
>  		do $GITWEB_CONFIG_SYSTEM;
>  		die $@ if $@;
> +	# if config file from env is missing, then try the default anyways

Minor nitpick: Actually that is not default, but build-time value, which has a default.

Show 8 quoted lines
> +	} elsif (-e "++GITWEB_CONFIG_SYSTEM++") {
> +		do "++GITWEB_CONFIG_SYSTEM++";
> +		die $@ if $@;
>  	}
>  }
>  
> -- 
> 1.7.0.4
Previous: Jakub NarebskiNext: Jonathan Nieder
Message 7 of 9 in “Use a default for a bad env config file variable”
  1. Use a default for a bad env config file variableJames, Aug 10, 2010
  2. Matthieu MoyAug 10, 2010
  3. JamesAug 10, 2010
  4. Ævar Arnfjörð BjarmasonAug 10, 2010
  5. Gitweb: Use a default for a bad env config file variableJames Shubin, Aug 10, 2010
  6. Jakub NarebskiAug 10, 2010
  7. James ShubinAug 11, 2010
  8. Jonathan NiederAug 11, 2010
  9. Michael J GruberAug 10, 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.