App::G...essage(3pm)

πŸ“¦
version 1.9.0 Β· 2 versions
, in fedora 43

✨ NAME ✨

App::GitHooks::CommitMessage β€” bestie, it's a git commit message. That's it, that's the whole thing πŸ’–

So real quick, this page lives in the User Contributed Perl Documentation section of the manual, and honestly? She's serving utility. Let's go.


πŸŽ€ VERSION πŸŽ€

Version 1.9.0 β€” yes queen, she's got a version number, respect her 🌸


πŸ’… METHODS πŸ’…

new()

Okay so this is how you birth a whole new commit message object, no cap:

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

Args you gotta pass in, and both of them are mandatory, so don't come to the function empty-handed πŸ™ˆ

  • app (mandatory) β€” an "App::GitHook" instance. That's the parent, the whole ecosystem, the mothership fr.
  • message (mandatory) β€” the commit message itself. Like, the actual words. Iconic.

update_message()

Update the commit message. New message, who dis ✨

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

get_lines()

Returns an arrayref of the lines that will be included in the commit message β€” and lowkey the important part: it excludes blank lines and comments. So it's giving curated. Filtered. Main character editing πŸ¦‹

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

Noting the defaults for you bestie, because they are not what you'd assume: include_comments defaults to 0, include_blank_lines defaults to 1. Periodt.


get_summary()

Returns the first line of the commit message. Just the first one. The trailer. The opening line of the whole saga πŸ’–

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

is_empty()

Tells you whether a commit message is empty β€” but after excluding comment lines and blank lines. So a message that's technically full of comments still counts as empty here, because she's not fooled πŸ’…

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

get_ticket_id()

Extracts and returns a ticket ID from the commit message. She's a detective, she found the ticket, slay πŸ”₯

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

has_changed()

Returns whether the message has changed since the object was created. Glow-up check ✨

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

🌈 ACCESSORS 🌈

get_original_message()

Returns the original message that was provided when the object was created. The before pic. The archive. The receipts πŸŽ€

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

get_message()

Returns the commit message itself. Present tense. Current era πŸ¦‹

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

get_app()

Returns the parent "App::GitHooks" object β€” aka the parent, the guardian, the one who pays the bills πŸ’œ

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.

Not me personally β€” the author. But like, the notification pipeline is real and it's giving transparency 🫢

🌸 SUPPORT 🌸

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

perldoc App::GitHooks::CommitMessage

You can also look for information at:

Four whole resources. She's well documented, she's got range πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

Guillaume Aubert <https://metacpan.org/author/AUBERTG>, "<aubertg at cpan.org>".


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.

Read that warranty line again bestie, she said NO WARRANTY in all caps and she MEANT it 😭 no promises, no guarantees, use at your own risk fr fr.

and that's the whole page, babes πŸ’– this was App::G...essage(3pm) β€” perl v5.42.0, dated 2025-07-25 β€” thanks for reading the whole thing, you're literally the best, go make some beautiful commits πŸŽ€βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from