Dist::Zilla::Plugin::Git::NextVersion(3pm)

Dist::Zilla::Plugin::Git::NextVersion3pm

Provide a version number by bumping the last git release tag

Usage

In your dist.ini:

    [Git::NextVersion]
    first_version = 0.001       ; this is the default
    version_by_branch = 0       ; this is the default
    version_regexp  = ^v(.+)$   ; this is the default

Version

version 2.051

Overview

This does the VersionProvider role. It finds the last version number from your Git tags, increments it using Version::Next, and uses the result as the "version" parameter for your distribution.

In addition, when making a release, it ensures that the version being released has not already been tagged. (The Git::Tag plugin has a similar check, but Git::Tag only checks for an exact match on the tag. Since Git::NextVersion knows how to extract version numbers from tags, it can find duplicates that Git::Tag would miss.)

The plugin accepts the following options:

•

"first_version" - if the repository has no tags at all, this version is used as the first version for the distribution. It defaults to "0.001".

•

"version_by_branch" - if true, consider only tags on the current branch when looking for the previous version. If you have a maintenance branch for stable releases and a development branch for trial releases, you should set this to 1. (You'll also need git version 1.6.1 or later.) The default is to look at all tags, because finding the tags reachable from a branch is a more expensive operation than simply listing all tags.

•

"version_regexp" - regular expression that matches a tag containing a version. It must capture the version into $1. Defaults to ^v(.+)$ which matches the default "tag_format" from the Git::Tag plugin. If you change "tag_format", you must set a corresponding "version_regexp".

You can also set the "V" environment variable to override the new version. This is useful if you need to bump to a specific version. For example, if the last tag is 0.005 and you want to jump to 1.000 you can set V = 1.000.

  $ V=1.000 dzil release

Because tracing history takes time, if you use the "version_by_branch" option, Git::NextVersion will create a .gitnxtver_cache file in your repository root to track the highest version number that is an ancestor of the HEAD revision. You should add .gitnxtver_cache to your .gitignore file. It will automatically be pruned from the distribution.

Support

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Git> (or [email protected] <mailto:[email protected]>).

There is also a mailing list available for users of this distribution, at <http://dzil.org/#mailing-list>.

There is also an irc channel available for users of this distribution, at "#distzilla" on "irc.perl.org" <irc://irc.perl.org/#distzilla>.

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

Author

Jerome Quelin

From libdist-zilla-plugin-git-perl 2.051-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.