Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Michal Nazarewicz
On Tue, Feb 12 2013, Junio C Hamano wrote: > I would actually vote for the most explicit: > > _cmd_close($ctx, (grep { defined } ($in, $out))); To me that looks weird at best, but I don't have strong opinions on that matter. -- Best regards, _ _

Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Jeff King
On Tue, Feb 12, 2013 at 01:14:57PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > On Tue, Feb 12, 2013 at 03:02:31PM +0100, Michal Nazarewicz wrote: > > > >> sub command_close_bidi_pipe { > >>local $?; > >>my ($self, $pid, $in, $out, $ctx) = _maybe_self(@_); > >> - _cmd_close($

Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Junio C Hamano
Jeff King writes: > On Tue, Feb 12, 2013 at 03:02:31PM +0100, Michal Nazarewicz wrote: > >> sub command_close_bidi_pipe { >> local $?; >> my ($self, $pid, $in, $out, $ctx) = _maybe_self(@_); >> -_cmd_close($ctx, $in, $out); >> +_cmd_close($ctx, grep defined, $in, $out); > > May

Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Michal Nazarewicz
On Tue, Feb 12 2013, Jeff King wrote: > On Tue, Feb 12, 2013 at 03:02:31PM +0100, Michal Nazarewicz wrote: > >> sub command_close_bidi_pipe { >> local $?; >> my ($self, $pid, $in, $out, $ctx) = _maybe_self(@_); >> -_cmd_close($ctx, $in, $out); >> +_cmd_close($ctx, grep defined, $

Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Jeff King
On Tue, Feb 12, 2013 at 03:02:31PM +0100, Michal Nazarewicz wrote: > sub command_close_bidi_pipe { > local $?; > my ($self, $pid, $in, $out, $ctx) = _maybe_self(@_); > - _cmd_close($ctx, $in, $out); > + _cmd_close($ctx, grep defined, $in, $out); Maybe it is just me, but I fin

[PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Michal Nazarewicz
From: Michal Nazarewicz The command_close_bidi_pipe() function will insist on closing both input and output pipes returned by command_bidi_pipe(). With this change it is possible to close one of the pipes in advance and pass undef as an argument. Signed-off-by: Michal Nazarewicz --- perl/Git.