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

Re: [RFC/PATCH] gitweb: Use list form of 'open "-|"' pipeline

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 8, 2008, 18:29 UTC
Message-ID
<200803081929.46306.jnareb@gmail.com>
In-Reply-To
<20080308175106.GA13855@hashpling.org>
On Sat, 8 Mar 2008, Charles Bailey wrote:
> On Sat, Mar 08, 2008 at 05:57:20PM +0100, Jakub Narebski wrote:
Show 17 quoted lines
>> Add output_pipeline subroutine, which allows to use list form of
>> pipeline; instead of
>>
>>   open my $fh, "-|", "cmd_1 option | cmd_2 argument"
>>
>> we can now write
>>
>>   my $fh = output_pipeline(['cmd_1', 'option'], ['cmd_2', 'argument']);
>>
>> which allows to avoid troubles with shell quoting, and avoid spawning
>> shell.  Code is based on snippet http://www.perlmonks.org/?node_id=246397
>> simplified a bit.
> 
> I'm not a Perl open expert, and I don't know if gitweb has other
> issues on windows anyway, but the list time I experimented with it
> neither the open( FHAND, "-|" ) trick, not the list form of open in
> combination with the "-|" mode worked at all on windows.

First, gitweb is git web interface; I don't know if anybody tried for example to run gitweb on Windows, be it from Apache or from IIS.

Second, it probably depends on the flavour (distribution) of Perl used. ActiveState Perl requires some horrible workarounds[*1*], I don't know what about MSys / MinGW Perl, Cygwin Perl, or Vanilla / Strawberry Perl.

[*1*] Git.pm, Perl interface to the Git, includes workaround for ActiveState Perl sheningans; gitweb currently doesn't use Git.pm (Git.pm would need some extensions), but perhaps it should. On the other hand it would make installation slightly more complicated.

-- 
Jakub Narebski
Poland
Previous: Charles BaileyNext: Frank Lichtenheld
Message 3 of 7 in “gitweb: Use list form of 'open "-|"' pipeline”
  1. gitweb: Use list form of 'open "-|"' pipelineJakub Narebski, Mar 8, 2008
  2. Charles BaileyMar 8, 2008
  3. Jakub NarebskiMar 8, 2008
  4. Frank LichtenheldMar 11, 2008
  5. Jakub NarebskiMar 11, 2008
  6. Frank LichtenheldMar 11, 2008
  7. Jay SoffianMar 12, 2008

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.