Subject: Re: [PATCH] gitweb: support perl 5.6

From: Jakub Narebski <[email-masked]>
Date: Sun, 10 Sep 2006 00:20:09 +0200

Sven Verdoolaege wrote:

> +# returns pipe reading from git command with given arguments
> +sub git_pipe {
> +       open my $fd, "-|", join(' ', git_cmd(), @_) or return undef;
> +       return $fd;
> +}
> +

I'm sorry, but this is not enough. For example the $file_name argument
should be quoted in shell, i.e. in three argument magic open "-|". So
either you return to your old patch, which changes each list form of open
"-|" into old three argument form (which adds penalty of additional shell
invocation, and is prone to shell interpretation of arguments), and
sometimes add quotes (e.g. "... \'$file_name\' ..."), or (what would be
better) to reimplement list form of open "-|" using two argument forking
open "-|", and doing exec in child, a la "Safe Pipe Opens" in perlipc(3pm).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git