git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Baudis <pasky@suse.cz>
To: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Cc: git@vger.kernel.org, jnareb@gmail.com, chriscool@tuxfamily.org
Subject: Re: [PATCH GSoC 1/3] gitweb: Create Gitweb::Config module
Date: Thu, 3 Jun 2010 17:20:30 +0200	[thread overview]
Message-ID: <20100603152030.GD20775@machine.or.cz> (raw)
In-Reply-To: <1275573356-21466-1-git-send-email-pavan.sss1991@gmail.com>

  Hi!

  I think this is a good start!

  I have couple of concerns; maybe they were addressed in the previous
discussion which I admit I did not read completely, but in that case
they ought to be addressed in the commit message as well.

On Thu, Jun 03, 2010 at 07:25:54PM +0530, Pavan Kumar Sunkara wrote:
> -our $t0;
> -if (eval { require Time::HiRes; 1; }) {
> -	$t0 = [Time::HiRes::gettimeofday()];

Why is this moved to Gitweb::Config? Shouldn't this be rather part of
Gitweb::Request?

> +# __DIR__ is taken from Dir::Self __DIR__ fragment
> +sub __DIR__ () {
> +	File::Spec->rel2abs(join '', (File::Spec->splitpath(__FILE__))[0, 1]);
>  }
> -our $number_of_git_cmds = 0;
> +use lib __DIR__ . "/lib";

Wouldn't it be more elegant to use FindBin? I'm just not sure how long
is it part of core Perl.

> +
> +use Gitweb::Config;
>  
>  BEGIN {
>  	CGI->compile() if $ENV{'MOD_PERL'};
>  }
>  
> -our $version = "++GIT_VERSION++";
> +$version = "++GIT_VERSION++";
>  
>  our ($my_url, $my_uri, $base_url, $path_info, $home_link);
>  sub evaluate_uri {
> @@ -68,402 +71,58 @@ sub evaluate_uri {
>  
>  # core git executable to use
>  # this can just be "git" if your webserver has a sensible PATH
> -our $GIT = "++GIT_BINDIR++/git";
> +$GIT = "++GIT_BINDIR++/git";

I dislike the new schema in one aspect - the list of configuration
variables together with their description is not at a single place
anymore: the build-time overridable variables have their descriptions
still in gitweb.pl and only very brief mentions in Gitweb::Config, while
the rest has moved fully to Gitweb::Config. I think it would be best to
move all descriptions to Gitweb::Config and keep only the override
assignments in gitweb.pl. So, Gitweb::Config would have

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

and gitweb.pl would have _just_

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

How does that sound?


I think you ought to add a comment in front of this section explaining
that not all configuration variables are listed here anymore. Something
like

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

>  # name of your site or organization to appear in page titles
>  # replace this with something more descriptive for clearer bookmarks
> -our $site_name = "++GITWEB_SITENAME++"
> +$site_name = "++GITWEB_SITENAME++"
>                   || ($ENV{'SERVER_NAME'} || "Untitled") . " Git";

This looks like some new feature; please do that in a separate patch.
(BTW, I assume that there are no other changes like this in the rest of
the moved code blocks!)

-- 
				Petr "Pasky" Baudis
The true meaning of life is to plant a tree under whose shade
you will never sit.

  parent reply	other threads:[~2010-06-03 15:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-03 13:55 [PATCH GSoC 1/3] gitweb: Create Gitweb::Config module Pavan Kumar Sunkara
2010-06-03 13:55 ` [PATCH GSoC 2/3] gitweb: Create Gitweb::Request module Pavan Kumar Sunkara
2010-06-03 13:55 ` [PATCH 3/3] git-instaweb: Add support for --reuse-config using gitconfig Pavan Kumar Sunkara
2010-06-03 15:20 ` Petr Baudis [this message]
2010-06-03 15:54   ` [PATCH GSoC 1/3] gitweb: Create Gitweb::Config module Ævar Arnfjörð Bjarmason
2010-06-03 16:59     ` Jakub Narebski
2010-06-03 17:04       ` Ævar Arnfjörð Bjarmason
2010-06-03 15:55   ` Jakub Narebski
2010-06-03 16:06     ` Petr Baudis
2010-06-03 16:11     ` Pavan Kumar Sunkara
2010-06-03 18:43       ` Jakub Narebski
2010-06-03 18:50         ` Pavan Kumar Sunkara
2010-06-03 16:00 ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100603152030.GD20775@machine.or.cz \
    --to=pasky@suse.cz \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=pavan.sss1991@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).