The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::GitHooks::CommitMessage - A git commit message.

VERSION

Version 1.9.0

METHODS

new()

        my $commit_message = App::GitHooks::CommitMessage->new(
                app     => $app,
                message => $message,
        );

Arguments:

  • app (mandatory)

    An App::GitHook instance.

  • message (mandatory)

    The commit message.

update_message()

Update the commit message.

        my $success = $commit_message->update_message( $new_message );

get_lines()

Return an arrayref of the lines that will be included in the commit message, excluding blank lines and comments.

        my $lines = $commit_message->get_lines(
                include_comments    => $include_comments,    # default: 0
                include_blank_lines => $include_blank_lines, # default: 1
        );

get_summary()

Return the first line of the commit message.

        my $summary = $commit_message->get_summary();

is_empty()

Indicate whether a commit message is empty, after excluding comment lines and blank lines.

        my $is_empty = $commit_message->is_empty();

get_ticket_id()

Extract and return a ticket ID from the commit message.

        my $ticket_id = $commit_message->get_ticket_id();

has_changed()

Return whether the message has changed since the object was created.

        my $has_changed = $commit_message->has_changed();

ACCESSORS

get_original_message()

Return the original message that was provided when the object was created.

        my $original_message = $commit_message->get_original_message();

get_message()

Return the commit message itself.

        my $message = $commit_message->get_message();

get_app()

Return the parent App::GitHooks object.

        my $app = $commit_message->get_app();

BUGS

Please report any bugs or feature requests through the web interface at https://github.com/guillaumeaubert/App-GitHooks/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::CommitMessage

You can also look for information at:

AUTHOR

Guillaume Aubert, <aubertg at cpan.org>.

COPYRIGHT & LICENSE

Copyright 2013-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.