Git::Re...AUTOLOAD(3)
β¨ Git::Repository::Plugin::AUTOLOAD β¨
okay bestie so this is a page from the User Contributed Perl Documentation, and it's all about Git::Repository::Plugin::AUTOLOAD π β literally the module that lets you call git subcommands like they're just... methods. no cap.
πΈ NAME πΈ
Git::Repository::Plugin::AUTOLOAD β Git subcommands as Git::Repository methods π
π¦ SYNOPSIS π¦
use Git::Repository 'AUTOLOAD';
my $r = Git::Repository->new();
$r->add($file);
$r->commit( '-m' => 'message' );
# NOTE: might be overridden by the 'Log' plugin
my $log = $r->log('-1');
# use "_" for "-" in command names
my $sha1 = $r->rev_parse('master');
# can be used as a class method
Git::Repository->clone( $url );
π DESCRIPTION π
so basically this module adds an AUTOLOAD method to Git::Repository, and that one little method makes it possible to automagically call git commands as methods on Git::Repository objects. it's giving wizardry, honestly π₯
π METHODS π
β AUTOLOAD β
any method call that gets caught by AUTOLOAD will simply turn all _ (underscore) into - (dash), and then call run() on the invocant, with that transformed method name as the first parameter. slay π
for example, this:
my $sha1 = $r->rev_parse('master');
does exactly the same thing as this:
my $sha1 = $r->run( 'rev-parse', 'master' );
all parameters from the original method call are kept, so these autoloaded methods can take option hashes. periodt.
heads up bestie: AUTOLOAD does not install methods in the invocant class (but like... what's the cost of a Perl subroutine call compared to forking a git subprocess?), so plugins that add new methods always take precedence. π
π SEE ALSO π
Git::RepositoryGit::Repository::Plugin
π«Ά AUTHOR π«Ά
Philippe Bruhat (BooK) <book@cpan.org>.
π COPYRIGHT π
Copyright 2014-2016 Philippe Bruhat (BooK), all rights reserved.
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page, you ate that π and for the lil sign-off moment: this one came from perl v5.42.0, dated 2025-07-25, and yes the page title is Git::Re...AUTOLOAD(3) π byeee π¦
π¦ where this page comes from
- fedora 43: perl-Git-Repository-Plugin-AUTOLOAD 1.003-29.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms