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

Re: [RFC/PATCHv3] git-instaweb: Add support for running gitweb via 'plackup'

From
Jakub Narebski <jnareb@gmail.com>
Date
May 25, 2010, 00:11 UTC
Message-ID
<201005250211.04469.jnareb@gmail.com>
In-Reply-To
<AANLkTikSXOrF-mS3XzVAohgoNXXNZwN3jBw6Sh4TnK6M@mail.gmail.com>
On Sun, 23 May 2010, Ævar Arnfjörð Bjarmason wrote:
Show 20 quoted lines
> 2010/5/22 Jakub Narebski <jnareb@gmail.com>:
> >
> > Webrick, which is in similar situation, uses httpd.conf config file in
> > YAML.  Unfortunately there is no config / serialization reader in Perl
> > core, so if we have to go this route either the config file would have
> > to be in Perl, or gitweb.psgi wrapper would have to include some simple
> > config file parsing.
> 
> You could easily do (pseudocode):
> 
>     unless (eval { require Config::Any; 1 }) {
>     	do $conf_file;
>     } else {
>     	my $parser = Config::Any->new( ... );
>     	$parser->docnf( $conf_file );
>     }
> 
> Then you'd read (eval) a perl config file by default, but remain
> compatible with saner config formats for users prepared to install
> things from the CPAN.
I was thinking more about something like that:
  my @opts = qw(--env deployment);
  while (<>) {
  	chomp;
  	next unless $_;  # skip empty lines
  	next if /^\s*#/; # skip comments
  	if (/^\s*(.*?)\s*=\s*(.*)\s*$/) {
  		push @opts, '--'.lc($1), $2;
  	}
  }
where httpd.conf would look like this:
  port = 1234
  host = 127.0.0.1

Anyway, if such code is to be be added, it would be added in a separate commit.

-- 
Jakub Narebski
Poland
Previous: Ævar Arnfjörð BjarmasonNext: Jakub Narebski
Message 9 of 12 in “git-instaweb: Add support for running gitweb via 'plackup'”
  1. git-instaweb: Add support for running gitweb via 'plackup'Jakub Narebski, May 19, 2010
  2. Jakub NarebskiMay 19, 2010
  3. [PATCHv2 (RFC)] git-instaweb: Add support for running gitweb via 'plackup'Jakub Narebski, May 20, 2010
  4. [RFC/PATCHv3] git-instaweb: Add support for running gitweb via 'plackup'Jakub Narebski, May 20, 2010
  5. Jakub NarebskiMay 22, 2010
  6. Eric WongMay 23, 2010
  7. Jakub NarebskiMay 23, 2010
  8. Ævar Arnfjörð BjarmasonMay 23, 2010
  9. Jakub NarebskiMay 25, 2010
  10. Jakub NarebskiMay 25, 2010
  11. Eric WongMay 23, 2010
  12. Jakub NarebskiMay 23, 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.