Normalize version tags #29

schwern opened this Issue Dec 12, 2009 · 3 comments


None yet
1 participant

schwern commented Dec 12, 2009

So 1.2.3 is tagged as v1.2.3. This makes versions stand out, follows the git semi-standard, and prevents versions like .01 from choking git.

v1.2.3 is left as v1.2.3.


schwern commented Aug 1, 2014

I've decided to prefix the versions with version/. This prefix might change (for example, cpan-version/ but the basic idea is the same.

It still seems worth normalizing the versions, if nothing else so the version tags sort well. A module with 1.2.2, v1.2.3 and 1.2.4 wouldn't sort properly without normalization.


schwern commented Aug 1, 2014

There's several needs here with versioning.

  1. Go from the CPAN release version to the gitpan tag with a minimum (or no) processing (and vice versa)
  2. Sort versions properly as gitpan tags.
  3. Provide a list of all released versions with no duplicates.

I think we need two tags for each committed release. One contains the version exactly as it exists on CPAN. This solves 1. Prefix it with cpan_version/.

The other contains the gitpan normalized version. This solves 2. Prefix it with gitpan_version/.

Either solve 3.

For example, Foo-Bar-v1.2.3 might be tagged as cpan_version/v1.2.3 and gitpan_version/1.2.3. Gitpan might even go as far as to convert 1.005000 to gitpan_version/1.5.0, but that's probably too much guesswork.

@schwern schwern changed the title from Normalize version tags with a v prefix to Normalize version tags Aug 4, 2014

@schwern schwern added this to the Pre-launch 2.0 milestone Aug 11, 2014

schwern added a commit that referenced this issue Aug 11, 2014

Move making versions tag safe into Gitpan::Git.
Gitpan::Release->normalize_version wasn't really normalizing the version
as #29 intends, it was just making it safe for tagging.  Every version
tag, normalized or not, will need that.  It doesn't really belong in
Gitpan::Release and it's not really normalization, so put it into
Gitpan::Git instead.

schwern added a commit that referenced this issue Aug 14, 2014

Add Gitpan::Release->gitpan_version for version normalization.
I've picked a small release with different version schemes to test with.

For #29

schwern added a commit that referenced this issue Aug 14, 2014


schwern commented Aug 14, 2014

There might be more normalization later, but this sets up the basic infrastructure and handles the most common case.

@schwern schwern closed this Aug 14, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment