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

Re: [RFC/PATCH 1/4] gitweb: Move subroutines to Gitweb::Config module

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 12, 2010, 01:01 UTC
Message-ID
<201006120301.37931.jnareb@gmail.com>
In-Reply-To
<AANLkTimq-46ghYT6TqXn1AB0NQIobcDaufsSJ5AEFE5z@mail.gmail.com>
On Tue, 8 June 2010, Ævar Arnfjörð Bjarmason wrote:
Show 7 quoted lines
> I haven't contributed to Gitweb, nor do I have to deal with it. But
> I've followed this series and reviewed most of the Perl code in
> Git. Take these with a grain of salt.
> 
> It would be very useful for the future of our Perl code if we had a
> dual-life system in Git. I.e. a cpan/ directory where we could drop
> CPAN modules that should be shipped with Git.
The standard name for such directory is 'inc/', I think.

There is for example 'inc::latest' module (unfortunately in core only since latest Perl, i.e. version 5.12), which uses modules bundled in 'inc/' if they are newer than installed ones. It is in Module-Build distribution.

BTW. it's a pity that PAR (Perl Archiving Toolkit, par.perl.org) is not in core...

Show 5 quoted lines
> 
> We already do this in a less sophisticated way for Error.pm, is there
> any reason not to expand it to install more CPAN modules if they
> aren't present on the system? That'd allow us to use them, but still
> only depend on vanilla Perl.

Sidenote about Error.pm: from what I understand modern consensus is that Error.pm was a failed approach, and currently recommended way to use exceptions in Perl is via block form of eval, e.g. Try::Tiny or TryCatch (this requires Moose and PPI), and not Error.

The Error documentation nowadays includes the following instructions:
  WARNING
  Using the "Error" module is no longer recommended due to the
  black-magical nature of its syntactic sugar, which often tends to
  break. Its maintainers have stopped actively writing code that uses
  it, and discourage people from doing so. See the "SEE ALSO" section
  below for better recommendations.
  [...]
  SEE ALSO
  See Exception::Class for a different module providing Object-Oriented
  exception handling, along with a convenient syntax for declaring
  hierarchies for them. It doesn't provide Error's syntactic sugar of
  'try { ... }, catch { ... }', etc. which may be a good thing or a bad
  thing based on what you want. (Because Error's syntactic sugar tends
  to break.)
  Error::Exception aims to combine Error and Exception::Class "with
  correct stringification".
  TryCatch and Try::Tiny are similar in concept to Error.pm only
  providing a syntax that hopefully breaks less.
Show 5 quoted lines
> 
> Then we could just use e.g. Config::General (~3k lines of code)
> instead of writing our own config system. There are probably lots of
> wheels that we're inventing (and are going to invent) that have been
> done better elsewhere, with more testing.
The problem with _optional_ Config::General config is that people
would have incompatibile gitweb config files, some using Config::General
syntax, some current configuration in Perl.
 
> Unlike Python or Java, Perl's policy is for core modules is to only
> include those required to better bootstrap the CPAN toolchain. So if
> we continue sticking to core Perl our code is only going to drift
> further away from Perl best practices.
Right.

Still, we don't want to require having half of CPAN in 'inc/' to install gitweb. Perhaps "no non-core dependencies" is too strict, and should be replaced by "minimal non-core depencencies".

-- 
Jakub Narebski
Poland
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 8 of 17 in “gitweb: Move subroutines to Gitweb::Config module”
  1. 1/4 gitweb: Move subroutines to Gitweb::Config modulePavan Kumar Sunkara, Jun 7, 2010
  2. 2/4 gitweb: Create Gitweb::HTML::Link modulePavan Kumar Sunkara, Jun 7, 2010
  3. 3/4 gitweb: Create Gitweb::HTML modulePavan Kumar Sunkara, Jun 7, 2010
  4. 4/4 gitweb: Create Gitweb::HTML::String modulePavan Kumar Sunkara, Jun 7, 2010
  5. Pavan Kumar SunkaraJun 7, 2010
  6. Jakub NarebskiJun 8, 2010
  7. Ævar Arnfjörð BjarmasonJun 8, 2010
  8. Jakub NarebskiJun 12, 2010
  9. Ævar Arnfjörð BjarmasonJun 12, 2010
  10. Jakub NarebskiJun 12, 2010
  11. Petr BaudisJun 8, 2010
  12. Pavan Kumar SunkaraJun 8, 2010
  13. Petr BaudisJun 8, 2010
  14. Pavan Kumar SunkaraJun 8, 2010
  15. Petr BaudisJun 8, 2010
  16. Jakub NarebskiJun 8, 2010
  17. Jakub NarebskiJun 9, 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.