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

Re: [PATCHv2/RFC] gitweb: Prepare for splitting gitweb

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 7, 2010, 10:30 UTC
Message-ID
<AANLkTinxDSS2G60_nQ12UqZpSJCvg_kfWYKzmTqJU7Ox@mail.gmail.com>
In-Reply-To
<1278496676-26575-1-git-send-email-jnareb@gmail.com>
On Wed, Jul 7, 2010 at 09:57, Jakub Narebski <jnareb@gmail.com> wrote:
Show 11 quoted lines
> [...]
>  use strict;
>  use warnings;
> +
> +use File::Spec;
> +# __DIR__ is taken from Dir::Self __DIR__ fragment
> +sub __DIR__ () {
> +       File::Spec->rel2abs(join '', (File::Spec->splitpath(__FILE__))[0, 1]);
> +}
> +use lib __DIR__ . '/lib';
> +

What was the result of the discussion about using __DIR__ again? You only need to use that method when you call a perl program whith *then* includes a module. If you just need to add the lib/ directory relative to the script you're invoking you can use FindBin:

    use FindBin qw($Bin);
    use lib "$Bin/lib";
Show 9 quoted lines
>  use CGI qw(:standard :escapeHTML -nosticky);
>  use CGI::Util qw(unescape);
>  use CGI::Carp qw(fatalsToBrowser set_message);
> @@ -16,6 +24,7 @@ use Encode;
>  use Fcntl ':mode';
>  use File::Find qw();
>  use File::Basename qw(basename);
> +
>  binmode STDOUT, ':utf8';
The whitespace change distracts from the real patch a bit.
Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 14 in “[PATCHv2/RFC] gitweb: Prepare for splitting gitweb”
  1. Jakub NarebskiJul 7, 2010
  2. Ævar Arnfjörð BjarmasonJul 7, 2010
  3. Jakub NarebskiJul 7, 2010
  4. Jakub NarebskiJul 8, 2010
  5. Jakub NarebskiJul 13, 2010
  6. Ævar Arnfjörð BjarmasonJul 13, 2010
  7. Jakub NarebskiJul 14, 2010
  8. Ævar Arnfjörð BjarmasonJul 14, 2010
  9. Jakub NarebskiJul 14, 2010
  10. Junio C HamanoJul 7, 2010
  11. Jakub NarebskiJul 7, 2010
  12. Junio C HamanoJul 8, 2010
  13. Jakub NarebskiJul 8, 2010
  14. [PATCHv3/RFC] gitweb: Prepare for splitting gitwebJakub Narebski, Jul 8, 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.