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

Re: [PATCH GSoC 1/3] gitweb: Create Gitweb::Config module

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 3, 2010, 15:54 UTC
Message-ID
<AANLkTikUmFA658jzd27cu1NmjJsV8T9Hkrd7z2WNY3R7@mail.gmail.com>
In-Reply-To
<20100603152030.GD20775@machine.or.cz>
On Thu, Jun 3, 2010 at 15:20, Petr Baudis <pasky@suse.cz> wrote:
> On Thu, Jun 03, 2010 at 07:25:54PM +0530, Pavan Kumar Sunkara wrote:
Show 6 quoted lines
>> -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?
>> +our @ISA = qw(Exporter);

This is also re-arranging deck chairs on the Titanic, but 'use base qw(Exporter)' is nicer.

Show 9 quoted lines
>> +# __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.

No, those don't do the same thing as discussed in previous reviews. FindBin finds the invoked binary, Dir::Self finds the the current file.

Previous: Petr BaudisNext: Jakub Narebski
Message 5 of 13 in “gitweb: Create Gitweb::Config module”
  1. 1/3 gitweb: Create Gitweb::Config modulePavan Kumar Sunkara, Jun 3, 2010
  2. 2/3 gitweb: Create Gitweb::Request modulePavan Kumar Sunkara, Jun 3, 2010
  3. 3/3 git-instaweb: Add support for --reuse-config using gitconfigPavan Kumar Sunkara, Jun 3, 2010
  4. Petr BaudisJun 3, 2010
  5. Ævar Arnfjörð BjarmasonJun 3, 2010
  6. Jakub NarebskiJun 3, 2010
  7. Ævar Arnfjörð BjarmasonJun 3, 2010
  8. Jakub NarebskiJun 3, 2010
  9. Petr BaudisJun 3, 2010
  10. Pavan Kumar SunkaraJun 3, 2010
  11. Jakub NarebskiJun 3, 2010
  12. Pavan Kumar SunkaraJun 3, 2010
  13. Ævar Arnfjörð BjarmasonJun 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.