Convenience wrapper around Git to provide config access routines.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-11-17 16:51:49 +00:00
dist Add explicit Provides to spec 2022-11-17 16:51:49 +00:00
lib/Git Ensure list return is always a list 2021-12-30 18:27:32 +00:00
Makefile.PL Correct URLs in Makefile.PL 2021-02-18 16:50:41 +00:00
README.md Ensure list return is always a list 2021-12-30 18:27:32 +00:00

NAME

Git::Cfg - Module to assist reading git configuration files

VERSION

version 0.8

SYNOPSIS

An example of use might be

use Git::Cfg;

my $cfg = new Git::Cfg( { '_filename'=>'project.gitconfig' } );

$val = $cfg->_get_cfg_var( 'main.flag' );

    or equivalent

$val = $cfg->main_flag;  # same as above

$val = $cfg->_get_cfg_var( 'othersection.otherflag' );

    or equivalent

$val = $cfg->othersection_otherflag;

and for accessing lists

$listref = $cfg->_get_cfg_var_list( 'multipleflags' );
# --get-all defaultsection.multipleflags

$listref = $cfg->_get_cfg_var_list( 'othersection.moreflags' );

and for getting the list of subsections

$arrayref = $cfg->_get_cfg_sections_matching( 'othersection' );

and for accessing whole sections

$hashref = $cfg->_get_cfg_section_hash( 'section_name' [, $initial_hashref ] );
# --get-regexp section.name.*

DESCRIPTION

Git::Cfg is a module to provide a object/method mechanism to obtain the contents of a gitconfig file.

METHODS

  • _get_cfg_var
  • _get_cfg_var_list
  • _get_cfg_sections_matching
  • _get_cfg_section_hash

COMPATIBILITY

  • Git::Cfg requires Git

AUTHOR

Bernard Quatermass toolsmith@quatermass.co.uk

COPYRIGHT AND LICENSE

This software is copyright (c) 2017,2020,2021 by Bernard Quatermass.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.