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

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

✨ App::G...hanges(3pm) πŸ’…

okay so bestie, you're looking at the App::GitHooks::StagedChanges manual page β€” it's a User Contributed Perl Documentation page (that's the 3pm part, iykyk), and it's literally all about staged changes in git. let's get into it 🫢


🌸 NAME 🌸

App::GitHooks::StagedChanged β€” staged changes in git. that's the vibe. periodt.


πŸŽ€ VERSION πŸŽ€

Version 1.9.0 ✨


πŸ’– METHODS πŸ’–

the main character section. every single one of these is a method you can call, so let's go πŸ¦‹

🌟 new()

makes you a brand new App::GitHooks::StagedChanges object. fresh out the box, no cap.

my $staged_changes = App::GitHooks::StagedChanges->new(
    app => $app,
);

Arguments:

  • app (mandatory) β€” an App::GitHook instance. you have to pass this one, it's not optional bestie, no skipping πŸ’€

🌟 get_app()

gives you back the parent App::GitHooks object. like, "who's your parent?" and it answers.

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

🌟 verify()

verifies the changes that are being committed. the vibe check of the whole operation honestly.

this method returns an array made up of:

  • a boolean telling you whether the checks passed or failed.
  • a boolean telling you whether any warnings got displayed.
( $allow_commit, $has_warnings ) = $staged_changes->verify();

🌟 check_changed_files()

verifies that the files that changed pass all the various rules. multiple files, multiple rules, so much going on.

this method returns an array made up of:

  • a boolean telling you whether the files passed the checks.
  • a boolean telling you whether any warnings got displayed.
my ( $all_files_pass, $has_warnings ) = check_changed_files();

🌟 check_file()

verifies that that one specific file passes all the verification rules. very "let's focus on you, babe" energy.

this method returns an array made up of:

  • a boolean telling you whether the file passed all the checks.
  • a boolean telling you whether any warnings got displayed.
my ( $file_passes, $has_warnings ) = check_file(
    count      => $count,
    file       => $file,
    git_action => $git_action,
    total      => $total,
);

Arguments:

  • count (mandatory) β€” the number of the file in the list of files to check.
  • file (mandatory) β€” the path of the file to check.
  • git_action (mandatory) β€” the action git performed on the file (add, delete, etc).
  • total (mandatory) β€” the total number of files to check as part of this git hooks instance.

🌟 run_parallelized_checks()

runs the checks for a given file in parallel. multitasking queen behavior, we love to see it πŸ”₯

run_parallelized_checks(
    tests     => $tests,
    file       => $file,
    git_action => $git_action,
);

Arguments:

  • tests β€” an arrayref of tests to run.
  • file β€” the path of the file being checked.
  • git_action β€” the type of action recorded by git on the file (deletion, addition, etc).

🌟 format_check_output()

formats the output of a check against a file into a printable string. it's giving glow-up for data ✨

format_check_output(
    app  => $app,
    data =>
    {
        name          => $name,
        return_value  => $return_value,
        error_message => $error_message,
    }
);

🌟 analyze_changes()

analyzes the state of the repository to detect whether the changes correspond to a merge or a revert operation. detective mode πŸ”

$staged_changes->analyze_changes();

🌟 is_revert()

returns true if the changes correspond to a git revert operation, false otherwise.

my $is_revert = $staged_changes->is_revert();

🌟 is_merge()

returns true if the changes correspond to a git revert operation, false otherwise.

my $is_merge = $staged_changes->is_merge();
not me side-eyeing the copy-paste in the original docs πŸ™ˆ but bestie, i'm just the messenger β€” that's literally what it says, so that's what you get. i don't make the rules πŸ’…

πŸ› BUGS πŸ›

please report any bugs or feature requests through the web interface at <https://github.com/guillaumeaubert/App-GitHooks/issues/new>. the author will be notified, and then you'll automatically be notified of progress on your bug as changes get made. so you're looped in, bestie, always 🫢


πŸ›Ÿ SUPPORT πŸ›Ÿ

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

perldoc App::GitHooks::StagedChanges

you can also look for information at:


πŸ‘‘ AUTHOR πŸ‘‘

Guillaume Aubert <https://metacpan.org/author/AUBERTG>, "<aubertg at cpan.org>". iconic, honestly πŸ’œ


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. (yes that's the loud part, keep it loud πŸ“’)


okay that's the whole page, you made it, I'm so proud πŸ₯Ή this was App::G...hanges(3pm) from perl v5.42.0, dated 2025-07-25. go forth and commit responsibly, bestie πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from