NAME

Module::Release::Git - Use Git with Module::Release

SYNOPSIS

The release script automatically loads this module if it sees a .git directory. The module exports check_vcs, vcs_tag, and make_vcs_tag.

For git status checks, you can ignore untracked files by setting ignore_untracked in .releaserc:

# .releaserc
ignore_untracked 1

DESCRIPTION

Module::Release::Git subclasses Module::Release, and provides its own implementations of the check_vcs() and vcs_tag() methods that are suitable for use with a Git repository.

These methods are automatically exported in to the callers namespace using Exporter.

This module depends on the external git binary (so far).

check_vcs()

Check the state of the Git repository. If you set the ignore_untracked config to a true value, git will not complain about untracked files.

get_recent_contributors()

Return a list of contributors since last release.

is_allowed_branch

Returns true if the current branch is allowed to release.

1. Look at the config for allowed_branches. That's a comma-separated list of allowed branch names. If the current branch is exactly any of those, return true. Or, keep trying.

2. Look at the config for allowed_branches_regex. If the current branch matches that Perl pattern, return true. Or, keep trying.

3. If the current branch is exactly master or main, return true.

4. Or, return false.

get_vcs_tag_format

Return the tag format. It's a sprintf-like syntax, but with one format:

%v  replace with the full version

If you've set in the configuration, it uses that. Otherwise it returns release-%v.

make_vcs_tag

By default, examines the name of the remote file (i.e. Foo-Bar-0.04.tar.gz) and constructs a tag string like release-0.04 from it. Override this method if you want to use a different tagging scheme, or don't even call it.

vcs_branch()

Return the current branch name.

vcs_commit_message_template()

Returns the config for commit_message_format, or the default '* for version %s'. This is a sprintf ready string. The first argument to sprintf is the release version.

vcs_commit_message()

Returns the commit message, using vcs_commit_message_template as the format.

vcs_exit

Perform repo tasks post-release. This one pushes origin to master and pushes tags.

vcs_tag(TAG)

Tag the release in local Git, using the value from make_vcs_tag.

TO DO

Use Gitlib.pm whenever it exists
More options for tagging

SEE ALSO

Module::Release::Subversion, Module::Release

SOURCE AVAILABILITY

This module is in Github:

https://github.com/briandfoy/module-release-git

AUTHOR

brian d foy, <briandfoy@pobox.com>

COPYRIGHT AND LICENSE

Copyright © 2007-2024, brian d foy <briandfoy@pobox.com>. All rights reserved.

You may redistribute this under the same terms as the Artistic License 2.0.