Skip Menu |

This queue is for tickets about the Dist-Zilla-Plugin-Git CPAN distribution.

Report information
The Basics
Id: 59505
Status: resolved
Priority: 0/
Queue: Dist-Zilla-Plugin-Git

People
Owner: Nobody in particular
Requestors: avar [...] cpan.org
Cc:
AdminCc:

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



Subject: Parsing Git versions with version->parse() doesn't work
Git versions are incompatible with version->parse(). Dist::Zilla::Plugin::Git fails tests on my machine which has a custom version of Git: $ perl -Ilib -d t/4-push.t Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. b 33main::(t/4-push.t:24): my $zilla = Dist::Zilla::Tester- Show quoted text
>from_config({
main::(t/4-push.t:25): dist_root => dir(qw(t push)), DB<1> DB<2> c Initialized empty Git repository in /home/avar/.cpanm/work/1279459995.17372/Dist-Zilla-Plugin-Git- 1.101801/tmp/wpQZTSTCcX/source/.git/ main::(t/4-push.t:33): my $gitversion = version->parse( $git- Show quoted text
>version );
DB<2> x $git->version 0 '1.7.2.rc3.125.g94e09.dirty' DB<3> x version->parse( $git->version ); Invalid version format (non-numeric data) at (eval 596)[/home/avar/perl5/perlbrew/perls/perl- 5.12.1/lib/5.12.1/perl5db.pl:638] line 2. DB<4> You might be able to get away with this if you do: my ($version) = $git->version =~ m[^( \d+ \. \d+ \. \d+ )]x; Or something try to call git and then skip the tests, or skip it if you can't parse the version. But that won't help if it also needs to do this at runtime (I haven't checked).
On Sun Jul 18 09:39:31 2010, AVAR wrote: Show quoted text
> Git versions are incompatible with version->parse(). > Dist::Zilla::Plugin::Git fails tests on my machine which has a custom > version of Git: > DB<2> x $git->version > 0 '1.7.2.rc3.125.g94e09.dirty'
d'oh! of course if you're using a non-stable git, i guess it doesn't work. Show quoted text
> You might be able to get away with this if you do: > my ($version) = $git->version =~ m[^( \d+ \. \d+ \. \d+ )]x; > > Or something try to call git and then skip the tests, or skip it if > you can't parse the version. But that won't help if it also needs to > do this at runtime (I haven't checked).
no, it only needs to do that during tests, since some platforms (essentially bsd) are only shipping pre-1.7.x git, and the tests were failing.
fixed in 1.102010, thanks for the report.