Skip Menu |

This queue is for tickets about the Git-Repository CPAN distribution.

Report information
The Basics
Id: 66783
Status: rejected
Priority: 0/
Queue: Git-Repository

People
Owner: Nobody in particular
Requestors: kaachips [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.17
Fixed in: (no value)



Subject: Command 'git shortlog' doesn't work
Hello I trying use Git::Repository for git command: git shortlog -ens and doesn't have any result. Script just waiting something. run and command methods have a same results. Use Git::Repository 1.17 perl version 5.10.1 Ubuntu 10.10
Subject: Re: [rt.cpan.org #66783] Command 'git shortlog' doesn't work
Date: Tue, 29 Mar 2011 16:21:22 +0200
To: Andrey Kuzmin via RT <bug-Git-Repository [...] rt.cpan.org>
From: "Philippe Bruhat (BooK)" <book [...] cpan.org>
On Tue, Mar 22, 2011 at 03:13:16PM -0400, Andrey Kuzmin via RT wrote: Show quoted text
> Tue Mar 22 15:13:16 2011: Request 66783 was acted upon. > Transaction: Ticket created by kaachips@gmail.com > Queue: Git-Repository > Subject: Command 'git shortlog' doesn't work > Broken in: 1.17 > Severity: Important > Owner: Nobody > Requestors: kaachips@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=66783 > > > > Hello > > I trying use Git::Repository for git command: git shortlog -ens and > doesn't have any result. Script just waiting something. > > run and command methods have a same results. > > Use Git::Repository 1.17 > perl version 5.10.1 > Ubuntu 10.10
I confirm that I can reproduce the bug. Will investigate. I have not a clue yet. -- Philippe Bruhat (BooK) Even the most powerful being is at the mercy of the weakest. (Moral from Groo The Wanderer #34 (Epic))
Subject: Re: [rt.cpan.org #66783] Command 'git shortlog' doesn't work
Date: Tue, 29 Mar 2011 18:41:20 +0200
To: Andrey Kuzmin via RT <bug-Git-Repository [...] rt.cpan.org>
From: "Philippe Bruhat (BooK)" <book [...] cpan.org>
On Tue, Mar 29, 2011 at 04:21:22PM +0200, Philippe Bruhat (BooK) wrote: Show quoted text
> > > > I trying use Git::Repository for git command: git shortlog -ens and > > doesn't have any result. Script just waiting something. > > > > run and command methods have a same results. > >
> I confirm that I can reproduce the bug. Will investigate. > > I have not a clue yet. >
git shortlog actually detects that it's not attached to a terminal, so it expects to parse some git log output sent on stdin. # hangs $ perl -MGit::Repository -le 'print scalar Git::Repository->run( qw( shortlog -5 ) )' # does not hang $ perl -MGit::Repository -le 'print scalar Git::Repository->run( qw( shortlog -5 ), input => "" )' The first version hangs because git shortlog expects some git log output on stdin, which is not provided. So it's not Git::Repository that is hanging, but git shortlog itself. The second version returns no output, because we just closed stdin. Here's a version that works on a small log output: perl -MGit::Repository -le 'print scalar Git::Repository->run( "shortlog", { input => scalar Git::Repository->run( qw( log -5 ) ) } )' Which larger ouput, you'll want to use Git::Repository::Command objects to avoid storing the whole log output in memory: use strict; use warnings; use Git::Repository; my $log = Git::Repository->command('log')->stdout; my $cmd = Git::Repository->command( shortlog => -ens ); my $in = $cmd->stdin; print {$in} $_ while <$log>; close $in; print $cmd->stdout->getlines; This works as expected. My conclusion is that it is an issue with how git shortlog works when not connected to a tty, and not an issue with Git::Repository. Regards, -- Philippe Bruhat (BooK) Freedom is not an individual effort. Yours comes only when you grant others theirs. (Moral from Groo The Wanderer #5 (Epic))