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

Re: [PATCH 1/4] instaweb: ignore GITWEB_CONFIG_SYSTEM

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 3, 2010, 18:20 UTC
Message-ID
<20100903182042.GB2341@burratino>
In-Reply-To
<7vfwxqzqoq.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
Show 7 quoted lines
>> The configuration in /etc/gitweb.conf might specify any old
>> layout; in particular, it is likely not to be identical to that
>> which git instaweb sets up.  Noticed by Uwe Kleine-König.
>
> I am not sure if this is a reasonable change by reading the above.  In
> some cases, the file may stale, but in other cases, it may specify what
> the site administrator wants its users to be using, no?
Yes, I should have mentioned this.

By analogy with .gitconfig, one might want "git instaweb" to check GITWEB_CONFIG_LOCAL, GITWEB_CONFIG_GLOBAL, and GITWEB_CONFIG_SYSTEM in that order, taking values from all three. A GITWEB_CONFIG envvar could override them all.

But stepping back a moment, what would this accomplish? The gitweb configuration specifies

 - what git version to use;
 - site branding;
 - what directory projects are relative to (*);
 - how deep to search for projects;
 - where the list of projects is (*);
 - how to demonstrate project consent to be shown (*);
 - whether to be a stickler about hiding secrets;
 - where gitweb.css, git-logo.png, git-favicon.png, and gitweb.js are (*);
 - base URI for relative paths used above (*);
 - what extra features (e.g. "snapshot") to enable;
 - MIME types, diff options, etc.

The items marked with a (*) are, in the regime used by git 1.7.1, specific to the "git instaweb" instance, since it is all about showing the current git repo and provides its own copies of gitweb.cgi instead of relying on copies in /usr/share/gitweb.

The items not marked with (*) might indeed benefit from some global site defaults. But unfortunately, that is already not what /etc/gitweb.conf is: it is rather used as a unit as a fallback when a separate gitweb_config.perl is not present.

In git 1.7.2 and later, "git instaweb" provides the gitweb_config.perl and this discussion becomes academic.

Show 6 quoted lines
>> -s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;'
>> +s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;
>> +s#(my|our) \$GITWEB_CONFIG_SYSTEM =.*#$1 \$GITWEB_CONFIG_SYSTEM = "";#;'
>
> Perhaps moving the last ' to its own line would help maintaining the
> script in the longer term?
Good idea; thanks.
Previous: Junio C HamanoNext: Jonathan Nieder
Message 6 of 14 in “git instaweb for Debian squeeze (Re: Bug#592733: git instaweb broken)”
  1. Jonathan NiederSep 2, 2010
  2. Eric WongSep 2, 2010
  3. 0/4 instaweb 1.7.1 fixes for Debian squeezeJonathan Nieder, Sep 2, 2010
  4. 1/4 instaweb: ignore GITWEB_CONFIG_SYSTEMJonathan Nieder, Sep 2, 2010
  5. Junio C HamanoSep 3, 2010
  6. Jonathan NiederSep 3, 2010
  7. Jonathan NiederSep 3, 2010
  8. Junio C HamanoSep 4, 2010
  9. Jonathan NiederSep 4, 2010
  10. 2/4 gitweb: skip logo in atom feed when there is noneJonathan Nieder, Sep 2, 2010
  11. 3/4 gitweb: make logo optionalJonathan Nieder, Sep 2, 2010
  12. 4/4 instaweb: disable logo and favicon by defaultJonathan Nieder, Sep 2, 2010
  13. 4/4 instaweb: disable logo and favicon by defaultJonathan Nieder, Sep 3, 2010
  14. Eric WongSep 3, 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.