[libgit-version-compare-perl] 01/04: Imported Upstream version 1.003

Angel Abad angel at debian.org
Mon May 9 16:37:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

angel pushed a commit to branch master
in repository libgit-version-compare-perl.

commit 54bdc026b47b4672d9e6618cdb13b0c7578580fe
Author: Angel Abad <angelabad at gmail.com>
Date:   Mon May 9 18:30:42 2016 +0200

    Imported Upstream version 1.003
---
 Changes                    |  3 +++
 META.json                  |  5 +++--
 META.yml                   |  3 ++-
 Makefile.PL                |  2 +-
 dist.ini                   |  1 +
 lib/Git/Version/Compare.pm |  6 ++++--
 t/looks_like_git.t         |  2 ++
 t/normalize.t              | 20 +++++++++++---------
 t/ops.t                    | 16 +++++++++-------
 9 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/Changes b/Changes
index bd687fc..13951aa 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Git-Version-Compare
 
+1.003 2016-05-03 BOOK
+    - Added support for version strings with comments (thanks to PINE)
+
 1.002 2016-04-27 BOOK
     - Increased the test coverage (from ~400 to ~11000 unit tests)
 
diff --git a/META.json b/META.json
index b253183..76c54e3 100644
--- a/META.json
+++ b/META.json
@@ -66,9 +66,10 @@
          "web" : "http://github.com/book/Git-Version-Compare"
       }
    },
-   "version" : "1.002",
+   "version" : "1.003",
    "x_contributors" : [
-      "Neil Bowers <neilb at cpan.org>"
+      "Neil Bowers <neilb at cpan.org>",
+      "Pine Mizune <pine at cpan.org>"
    ]
 }
 
diff --git a/META.yml b/META.yml
index a0436a3..483b7c9 100644
--- a/META.yml
+++ b/META.yml
@@ -30,6 +30,7 @@ requires:
 resources:
   bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Git-Version-Compare
   repository: http://github.com/book/Git-Version-Compare.git
-version: '1.002'
+version: '1.003'
 x_contributors:
   - 'Neil Bowers <neilb at cpan.org>'
+  - 'Pine Mizune <pine at cpan.org>'
diff --git a/Makefile.PL b/Makefile.PL
index 2b3cc42..b5f6133 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -29,7 +29,7 @@ my %WriteMakefileArgs = (
     "List::Util" => 0,
     "Test::More" => 0
   },
-  "VERSION" => "1.002",
+  "VERSION" => "1.003",
   "test" => {
     "TESTS" => "t/*.t"
   }
diff --git a/dist.ini b/dist.ini
index 438279b..4b7bc8e 100644
--- a/dist.ini
+++ b/dist.ini
@@ -53,3 +53,4 @@ keywords = git version comparison
 
 [Meta::Contributors]
 contributor = Neil Bowers <neilb at cpan.org>
+contributor = Pine Mizune <pine at cpan.org>
diff --git a/lib/Git/Version/Compare.pm b/lib/Git/Version/Compare.pm
index ee8dfae..1c479b0 100644
--- a/lib/Git/Version/Compare.pm
+++ b/lib/Git/Version/Compare.pm
@@ -1,5 +1,5 @@
 package Git::Version::Compare;
-$Git::Version::Compare::VERSION = '1.002';
+$Git::Version::Compare::VERSION = '1.003';
 use strict;
 use warnings;
 use Exporter;
@@ -66,6 +66,7 @@ sub looks_like_git {
           [0-9]+(?:[.-](?:0[ab]?|[1-9][0-9a-z]*|[a-zA-Z]+))*  # x.y.z.*
           (?:[.-]?rc[0-9]+)?                                  # rc
           (?:[.-](GIT|[1-9][0-9]*[.-]g[A-Fa-f0-9]+))?         # devel
+          (?:\ .*)?                                           # comment
          $/x;
 }
 
@@ -77,9 +78,10 @@ sub _normalize {
     croak "$v does not look like a Git version" if !looks_like_git($v);
 
     # reformat git.git tag names, output of `git --version`
-    $v =~ s/^v|^git version |\.msysgit.*//g;
+    $v =~ s/^v|^git version |\.msysgit.*|[\012\015]+\z//g;
     $v =~ y/-/./;
     $v =~ s/0rc/0.rc/;
+    ($v) = split / /, $v;    # drop anything after the version
     return $version_alias{$v} if defined $version_alias{$v};
 
     my @v = split /\./, $v;
diff --git a/t/looks_like_git.t b/t/looks_like_git.t
index 19795b5..98836aa 100644
--- a/t/looks_like_git.t
+++ b/t/looks_like_git.t
@@ -6,7 +6,9 @@ use Git::Version::Compare qw( looks_like_git eq_git );
 my @ok = (
 
     # actual output from `git --version`
+    "git version 1.0.0a\n",
     "git version 2.7.0\n",
+    "git version 2.6.4 (Apple Git-63)\n",
 
     # just the version number
     '0.99.7', '0.99.9l', '1.2.3', '1.2.3', '1.8.0.rc3', '1.8.0', '1.8.0.3',
diff --git a/t/normalize.t b/t/normalize.t
index 6b4bc1e..67bd0b6 100644
--- a/t/normalize.t
+++ b/t/normalize.t
@@ -7,15 +7,17 @@ my @tests = (
     [ undef, undef ],
 
     # actual output from `git --version`
-    [ '0.99.7',                '00.99.07.00.00.0000' ],
-    [ '0.99.9l',               '00.99.09.12.00.0000' ],
-    [ '1.2.3',                 '01.02.03.00.00.0000' ],
-    [ '1.2.3',                 '01.02.03.00.00.0000' ],
-    [ '1.8.0.rc3',             '01.08.00.00-03.0000' ],
-    [ '1.8.0',                 '01.08.00.00.00.0000' ],
-    [ '1.8.0.3',               '01.08.00.03.00.0000' ],
-    [ '1.8.5.4.19.g5032098',   '01.08.05.04.00.0019' ],
-    [ '2.3.0.rc0.36.g63a0e83', '02.03.00.00-00.0036' ],
+    [ '0.99.7',                             '00.99.07.00.00.0000' ],
+    [ '0.99.9l',                            '00.99.09.12.00.0000' ],
+    [ '1.2.3',                              '01.02.03.00.00.0000' ],
+    [ '1.2.3',                              '01.02.03.00.00.0000' ],
+    [ '1.8.0.rc3',                          '01.08.00.00-03.0000' ],
+    [ '1.8.0',                              '01.08.00.00.00.0000' ],
+    [ '1.8.0.3',                            '01.08.00.03.00.0000' ],
+    [ '1.8.5.4.19.g5032098',                '01.08.05.04.00.0019' ],
+    [ '2.3.0.rc0.36.g63a0e83',              '02.03.00.00-00.0036' ],
+    [ "git version 2.7.0\n",                '02.07.00.00.00.0000' ],
+    [ "git version 2.6.4 (Apple Git-63)\n", '02.06.04.00.00.0000' ],
 
     # Win32 msysgit
     [ '1.9.4.msysgit.0', '01.09.04.00.00.0000' ],
diff --git a/t/ops.t b/t/ops.t
index d797c54..b293a45 100644
--- a/t/ops.t
+++ b/t/ops.t
@@ -85,18 +85,20 @@ my @sorted = (
     '1.7.1.1',                '1.7.1.1.1.g66bd8ab',
     '1.7.2.rc0',              '1.7.2.rc0.1.g078e',
     '1.7.2.rc0.10.g1ba5c',    '1.7.2.rc0.13.gc9eaaa',
+    'git version 2.6.4 (Apple Git-63)',
     'git version 2.8.0.rc3',  'v2.8.0.2',
 );
 
 my @same = (
     [ '0.99.9l', '1.0rc4' ],
-    [ '1.0.0',                'v1.0.0',  '1.0' ],
-    [ '1.0.0a',               '1.0.1' ],
-    [ '1.0.0b',               'v1.0.0b', '1.0.2' ],
-    [ '1.0.rc2',              '0.99.9i' ],
-    [ '1.7.1',                'v1.7.1',  '1.7.1.0' ],
-    [ '1.7.1.1.gc8c07',       '1.7.1.1.g5f35a' ],
-    [ '1.7.2.rc0.13.gc9eaaa', '1.7.2.rc0.13.gc9eaaa' ],
+    [ '1.0.0',                            'v1.0.0',  '1.0' ],
+    [ '1.0.0a',                           '1.0.1' ],
+    [ '1.0.0b',                           'v1.0.0b', '1.0.2' ],
+    [ '1.0.rc2',                          '0.99.9i' ],
+    [ '1.7.1',                            'v1.7.1',  '1.7.1.0' ],
+    [ '1.7.1.1.gc8c07',                   '1.7.1.1.g5f35a' ],
+    [ '1.7.2.rc0.13.gc9eaaa',             '1.7.2.rc0.13.gc9eaaa' ],
+    [ 'git version 2.6.4 (Apple Git-63)', '2.6.4' ],
     [ 'git version 2.7.0', '2.7', '2.7.0', '2.7.0.0' ],
 );
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libgit-version-compare-perl.git



More information about the Pkg-perl-cvs-commits mailing list