Mailing List Archive

Re: [interchange] Normalize the version returned by the get_dist_version()
On 04/11/17 04:18, David Christensen wrote:
> + # standardize/handle old tagged REL tags
> + if ($vers =~ /^REL_(\d+)_(\d+)_(\d+)(-(\d+)-g(\w+))/) {
> + $vers = "$1.$2.$3";
> + $vers .= '-devel-' . $6 if $4;

The "if $4" is redundant here, because the regex above won't match at
all without it. You probably want to make the $4 grouping optional by
following it with a "?" in the regex.

> + }
> + elsif ($vers =~ /^(\d+)\.(\d+)\.(\d+)(-(\d+)-g(\w+))/) {
> + $vers = "$1.$2.$3-devel-$6";
> + }

In both of the above you're donking the commit counter (the $5 part).
I'd like to go on record saying that I like that part of the version
number because it gives an easily human-readable way to determine if a
particular commit is older or newer.


Peter

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: [interchange] Normalize the version returned by the get_dist_version() [ In reply to ]
> On Nov 3, 2017, at 1:48 PM, Peter <peter@pajamian.dhs.org> wrote:
>
> On 04/11/17 04:18, David Christensen wrote:
>> + # standardize/handle old tagged REL tags
>> + if ($vers =~ /^REL_(\d+)_(\d+)_(\d+)(-(\d+)-g(\w+))/) {
>> + $vers = "$1.$2.$3";
>> + $vers .= '-devel-' . $6 if $4;
>
> The "if $4" is redundant here, because the regex above won't match at
> all without it. You probably want to make the $4 grouping optional by
> following it with a "?" in the regex.

Yeah, that was an earlier revision, cleaned some things up more since then.

>> + }
>> + elsif ($vers =~ /^(\d+)\.(\d+)\.(\d+)(-(\d+)-g(\w+))/) {
>> + $vers = "$1.$2.$3-devel-$6";
>> + }
>
> In both of the above you're donking the commit counter (the $5 part).
> I'd like to go on record saying that I like that part of the version
> number because it gives an easily human-readable way to determine if a
> particular commit is older or newer.


Okay, makes sense; the original motivation for transforming from git’s native format was MakeMaker was complaining about not being able to parse the version. I think that would have been the REL_… part though, so I’ll see if I can get that reintroduced.

Best,

David
--
David Christensen
End Point Corporation
david@endpoint.com
785-727-1171