Config...e::Git(3pm)

πŸ“¦
version 1.18 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 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