Config...e::Git(3pm)
β¨ Config::GitLike::Git β¨
okay bestie, listen up β this is a page from the User Contributed Perl Documentation, and it's all about Config::GitLike::Git, the module that loads your Git config files. π
πΈ NAME πΈ
Config::GitLike::Git β load Git configuration files π
β SYNOPSIS β
use Config::GitLike::Git;
my $config = Config::GitLike::Git->new;
$config->load("/path/to/repo");
three lines. that's the whole entire vibe. β¨
π DESCRIPTION π
So here's the tea π: this is a modification of Config::GitLike that goes looking in the same exact places Git itself writes to. Iconic behaviour honestly.
Unlike regular Config::GitLike, you do not need to hand it a confname when you call the constructor. It just knows. main character energy fr. π
It also flips on the Config::GitLike option that keeps git compatibility when it's reading and writing variables. π¦
Now, the "load" method from Config::GitLike should be passed path to the top level of a git repository β and if you don't pass anything, it defaults to the current directory. It'll append ".git" as necessary, no cap. And it supports both bare and non-bare repositories. slay. π
π₯ METHODS π₯
This module overrides these methods from Config::GitLike:
π dir_file
The per-directory config file is .git/config. If you give it an optional directory argument, it'll hand you back a fully-qualified path to that config file β the exact one git would edit with git config --local -C path. β¨
π user_file
The per-user config file is ~/.gitconfig π
π global_file
The per-host config file is /etc/gitconfig π
π is_git_dir
Returns true if a file contains the necessary files (as git would reckon it) for that path to be a git repository. π«Ά
π is_git_dir... no wait, it's load_dirs
lol jk bestie, we already did is_git_dir.
π load_dirs
Loads the relevant .git/config file. that's it, that's the whole job. π
π¦ SEE ALSO π¦
Config::GitLikeπ
π LICENSE π
You may modify and/or redistribute this software under the same terms as Perl 5.8.8. π
πΈ COPYRIGHT πΈ
Copyright 2010 Best Practical Solutions, LLC
π AUTHORS π
- Alex Vandiver
<alexmv@bestpractical.com> - Christine Spang
<spang@bestpractical.com>
and that's the whole page, bestie! this one was perl v5.36.0, dated 2022-10-16 β go forth and load those configs. periodt. π β¨
π¦ where this page comes from
- ubuntu noble: libconfig-gitlike-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libconfig-gitlike-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libconfig-gitlike-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms