git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC] Splitting gitweb and build-time configuration variables
@ 2010-08-17 18:15 Jakub Narebski
  2010-08-18  3:03 ` Jonathan Nieder
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Narebski @ 2010-08-17 18:15 UTC (permalink / raw)
  To: git; +Cc: Christian Couder, Petr Baudis, Pavan Kumar Sunkara, John Hawley

I am planning on picking up and resubmitting "splitting gitweb" series,
which was created by Pavan as a prerequisite for adding write and admin
support to gitweb ("Splitting gitweb and developing write 
functionalities (Integrated web client for git)" GSoC 2010 project).

There is a question what to do about gitweb configuration variables 
which are set during build time, like e.g.:

  # URI of stylesheets
  our @stylesheets = ("++GITWEB_CSS++");

or

  # core git executable to use
  # this can just be "git" if your webserver has a sensible PATH
  our $GIT = "++GIT_BINDIR++/git";


I think it was agreed that _setting_ these variables would be left in 
gitweb.perl, to have one single place which gathers all such variables, 
and to have gitweb/Makefile to munge (transform) only a single file.

So those variables would be _declared_ in appropriate gitweb module 
(Gitweb::Git aka Gitweb::Command, Gitweb::Config, Gitweb::Util etc.)
but would be _defined_ (set to value) in gitweb.perl.  The final goal is 
to have gitweb.perl consist only of loading modules, build-time 
configuration, and starting gitweb (calling run() or similarly named 
subroutine or method).

The question is where *description* of those build time configuration 
variables should be (see the above examples).  Should it be:

1. Description of build-time configuration variable is in the module
   that defines it, and each block of variables coming from the same
   module would have notice where one can find description of those
   variables, like in original patches by Pavan, e.g.:

     # Only configuration variables with build-time overridable
     # defaults are listed below. The complete set of variables
     # with their descriptions is listed in Gitweb::Config.

or

2. Description of build-time configuration variables is in gitweb.perl,
   and in each module there is comment that full description of those
   variables can be found there, e.g. (proposal):

     # Values of those variables are set during build time in 
     # gitweb/gitweb.perl (main script).  You can find their description
     # there.

or perhaps

3. Duplicate description of those variables, to have it both in
   appropriate module and in gitweb.perl


What do you think about it?

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] Splitting gitweb and build-time configuration variables
  2010-08-17 18:15 [RFC] Splitting gitweb and build-time configuration variables Jakub Narebski
@ 2010-08-18  3:03 ` Jonathan Nieder
  2010-08-18  8:05   ` Jakub Narebski
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Nieder @ 2010-08-18  3:03 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: git, Christian Couder, Petr Baudis, Pavan Kumar Sunkara,
	John Hawley

Jakub Narebski wrote:

> 1. Description of build-time configuration variable is in the module
>    that defines it, and each block of variables coming from the same
>    module would have notice where one can find description of those
>    variables
[...]
> 2. Description of build-time configuration variables is in gitweb.perl,
>    and in each module there is comment that full description of those
>    variables can be found there, e.g. (proposal):
> 
>      # Values of those variables are set during build time in 
>      # gitweb/gitweb.perl (main script).  You can find their description
>      # there.
[...]
> 3. Duplicate description of those variables

With #2, a person reading the Makefile can grep for some particular
substitution (++GITWEB_PROJECTROOT++) and quickly find the name and
description of the variable it is used for.  If there were a 1:1
correspondence between the variables in gitweb.perl and the Makefile,
I would even suggest moving the description to the Makefile.

In practice, I suspect the run-time configuration is more important to
people.  That is already fairly well documented in gitweb/README.

Just my two cents,
Jonathan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] Splitting gitweb and build-time configuration variables
  2010-08-18  3:03 ` Jonathan Nieder
@ 2010-08-18  8:05   ` Jakub Narebski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Narebski @ 2010-08-18  8:05 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: git, Christian Couder, Petr Baudis, Pavan Kumar Sunkara,
	John Hawley

On Wed, 18 Aug 2010, Jonathan Nieder wrote:
> Jakub Narebski wrote:
> 
> > 1. Description of build-time configuration variable is in the module
> >    that defines it, and each block of variables coming from the same
> >    module would have notice where one can find description of those
> >    variables
> [...]
> > 2. Description of build-time configuration variables is in gitweb.perl,
> >    and in each module there is comment that full description of those
> >    variables can be found there, e.g. (proposal):
> > 
> >      # Values of those variables are set during build time in 
> >      # gitweb/gitweb.perl (main script).  You can find their description
> >      # there.
> [...]
> > 3. Duplicate description of those variables
> 
> With #2, a person reading the Makefile can grep for some particular
> substitution (++GITWEB_PROJECTROOT++) and quickly find the name and
> description of the variable it is used for.  If there were a 1:1
> correspondence between the variables in gitweb.perl and the Makefile,
> I would even suggest moving the description to the Makefile.

There is a bit of difference between Perl variables in gitweb.perl and
make build-time variables in gitweb/Makefile, namely:

  our $GIT = "++GIT_BINDIR++/git";

  our $site_name = "++GITWEB_SITENAME++"
                 || ($ENV{'SERVER_NAME'} || "Untitled") . " Git";

  our @stylesheets = ("++GITWEB_CSS++");

  our @git_base_url_list = grep { $_ ne '' } ("++GITWEB_BASE_URL++");

  our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
  our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'}
                            || "++GITWEB_CONFIG_SYSTEM++";

Perl variables can be overriden in run-time configuration (testsuite
uses this to test _source_ version i.e. gitweb.perl rather than 
generated gitweb.cgi), so they have to be described anyway.

I think that adding description of make variables to gitweb/Makefile,
similar to what main Makefile does, would be a good idea, though I don't
like that it leads to some duplication.

> 
> In practice, I suspect the run-time configuration is more important to
> people.  That is already fairly well documented in gitweb/README.

Build-time configuration is also described in gitweb/README, in more
detail.

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-18  8:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17 18:15 [RFC] Splitting gitweb and build-time configuration variables Jakub Narebski
2010-08-18  3:03 ` Jonathan Nieder
2010-08-18  8:05   ` Jakub Narebski

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).