Subject: | No way to obtain data sent from git via STDERR |
If data is written to STDERR, its stuffed in @err, but if the command succeeds, @err then disappears and all you can get out is @out.
This effectively means 2 things.
1. Its not possible to get git itself to report things verbosely to the user via stderr ( as it is captured )
2. Its not possible for any consuming code to report things verbosely ( as the captured data is disposed of ).
I've long mused over the idea that perhaps Git::Wrapper should support alternative interfaces, eg:
my $command = $wrapper->remote('--verbose', 'update' , $remotename ); # wantarray scalar context =~ returns an object and doesn't do anything on its own.
while( my $line = $command->getline ) { } # makes the command run line-fed
my @out = $command->out(); # the same as push @out, $_ while $_ = $command->getline
my @error = $command->error(); # gets data written to stderr
but this is just nice to have future stuff.
I'd be satisfied enough if it simply set some array on the wrapper instance itself at the end, ie: $self->{err} = \@err;
and then it was up to me to read that in a sensible way.
Thanks in advance.