NAME

App::GitHooks::Plugin::VersionTagsRequireChangelog - Require git version tags to have a matching changelog entry.

DESCRIPTION

This is a companion plugin for App::GitHooks::Plugin::NotifyReleasesToSlack. NotifyReleasesToSlack simply skips git version tags without a matching entry in the changelog file, and this plugin allows you to force git version tags to have a matching entry in the changelog file.

For example, you cannot do this:

git tag v1.0.0
git push origin v1.0.0

Unless your changelog file has a release entry for v1.0.0.

VERSION

Version 1.1.0

CONFIGURATION OPTIONS

This plugin supports the following options in the [VersionTagsRequireChangelog] section of your .githooksrc file.

[VersionTagsRequireChangelog]
changelog_path = Changes

changelog_path

The path to the changelog file, relative to the root of the repository.

For example, if the changelog file is named Changes and lives at the root of your repository:

changelog_path = Changes

METHODS

run_pre_push()

Code to execute as part of the pre-push hook.

my $plugin_return_code = App::GitHooks::Plugin::VersionTagsRequireChangelog->run_pre_push(
	app   => $app,
	stdin => $stdin,
);

Arguments:

  • $app (mandatory)

    An App::GitHooks object.

  • $stdin (mandatory)

    The content provided by git on stdin, corresponding to a list of references being pushed.

FUNCTIONS

get_pushed_tags()

Retrieve a list of the tags being pushed with git push.

my $tags = App::GitHooks::Plugin::VersionTagsRequireChangelog::get_pushed_tags(
	$app,
	$stdin,
);

Arguments:

  • $app (mandatory)

    An App::GitHooks object.

  • $stdin (mandatory)

    The content provided by git on stdin, corresponding to a list of references being pushed.

get_changelog_releases()

Retrieve a hashref of all the releases in the changelog file.

my $releases = App::GitHooks::Plugin::VersionTagsRequireChangelog::get_changelog_releases(
	$app,
);

Arguments:

  • $app (mandatory)

    An App::GitHooks object.

BUGS

Please report any bugs or feature requests through the web interface at https://github.com/guillaumeaubert/App-GitHooks-Plugin-VersionTagsRequireChangelog/issues/new. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc App::GitHooks::Plugin::VersionTagsRequireChangelog

You can also look for information at:

AUTHOR

Guillaume Aubert, <aubertg at cpan.org>.

COPYRIGHT & LICENSE

Copyright 2015-2017 Guillaume Aubert.

This code is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for more details.