Skip to content

Releases: fsaintjacques/semver-tool

v3.4.0 "prerelease" keyword supported in "bump" and "get" sub-commands

12 Oct 12:40
837ad91
Compare
Choose a tag to compare

The synonym "prerelease" can be used anywhere the existing keyword "prerel" is used. This facilitates using the output from the "diff" sub-command. See issue #51 and PR #69. The usage string and README have been updated accordingly.

v3.3.0 New license as Apache-2.0 License and new "validate" sub-command

14 Jan 17:44
1306402
Compare
Choose a tag to compare

The semver-tool was re-licensed to Apache-2.0 License as per
multiple requests. Thanks for the multiple parties leading that effort.

Add "validate" command to validate semver strings. Validate if the input
version follows the SEMVER pattern. Print 'valid' to stdout if the version
is valid, otherwise print 'invalid'.

v3.2.0 Add "bump prerel" with an incrementing numeric portion

13 Jan 17:00
Compare
Choose a tag to compare
Add "bump prerel" with an incrementing numeric portion.

The basic approach is that currently disallowed usages of "bump prerel"
can be used to introduce numerical bumping of a trailing numeric portion of
a PRERELEASE string.

Previously, "bump prerel" required an argument that was simply used as
the new PRERELEASE string; with any BUILD part removed. The argument
needed to be a correct PRERELEASE string. In particular, it could not
contain a trailing dot.

Here, a trailing dot denotes a numeric portion that is either created or
updated. "Updated" means "incremented by one". The previous functionality
(simple replacement) remains. If a trailing dot is present, the
"<prerel>" argument is used as a prototype and the new functionality
is invoked. Note that any BUILD part is always removed.

For example, here a PRERELEASE field with an initial value is created:

    semver bump prerel rc. 1.0.1 => 1.0.1-rc1

If the prototype matches the existing PRERELEASE part, then the
numeric portion is incremented:

    semver bump prerel rc. 1.0.1-rc1 => 1.0.1-rc2

This is important for scripting: the same prototype argument can be
used for initial and subsequent applications, removing the need for
different flows or external state.

If the existing PRERELEASE does not match the prototype, the prototype
is used as in the first example above.

Note that it is possible to add (or increment) a numerical portion
as a separate identifier within the PRERELEASE field using two dots:

    semver bump prerel beta.. 2.2.0 => 2.2.0-beta.1

Using a separate identifier is "safer" in that it avoids false version
comparisons when, for example, the numeric portion increments from
9 to 10.  6.4.0-beta9 is "greater" than 6.4.0-beta10 given the semantic
versioning comparison rules while 6.4.0-beta.9 is "less" than
6.4.0-beta.10

Previously, "bump prerel" required two arguments (new PRERELEASE and
existing version). With this new functionality, "bump prerel" with
a single argument (existing version) implies adding or incrementing
a trailing numerical portion based solely on the existing (or empty)
PRERELEASE field: if the numerical portion exists, it is incremented;
if not, it is added starting at one.

Some examples:

    semver bump prerel 5.2.1-rc2 => 5.2.1-rc3
    semver bump prerel 5.2.1-beta => 5.2.1-beta1
    semver bump prerel 5.2.1 => 5.2.1-1

Also: the semver tool version string is now set to 3.2.0  This new
functionality is backwards compatible with 3.1.0

The USAGE string and README.md have been updated. Examples demonstrating
the new functionality have been added.

As well, minor corrections have been made to the README and it is (again)
in sync with the USAGE string.

During the README and USAGE updates, the "diff" command documentation
was completed.

New unit tests exercising the bump prerel functionality have been
added in "tests/bump_prerel.bats". All pass. Manual inspection
indicates that all new/changed code paths are tested.
The previous test suite passes (no regression) except for
the error cases that have now become valid. These tests
have been removed.

Version 3.2.0 targeted: in semver code and README.md badge.