Author image Kent Fredric (PAUSE Custodial Account)
and 1 contributors


Perl::Build::Git - Convenience extensions for Perl::Build for bulk git work


version 0.001000


This is something that might be useful to call in a git bisect runner

    use Perl::Build::Git;
    my $man         = [qw( man1dir man3dir siteman1dir siteman3dir  )];
    my $no_man_opts = [ map { '-D' . $_ . '=none' } @{$man} ];
    my $install = Perl::Build::Git->install_git(
            persistent => 1,
            preclean   => 1,
            cache_root => '/tmp/perls/',
            git_root   => '/path/to/git/checkout',
            configure_options => [
                '-de',               # quiet automatic
                '-Dusedevel',        # "yes, ok, its a development version"
                @{$no_man_opts},     # man pages are ugly
                '-U versiononly',    # use bin/perl, not bin/perl5.17.1
            # Test Case Here
            exit 255 if $failed;
    exit 0;

persistent = 1 is intended to give each build its own unique directory, such as


So that if you do multiple bisects, ( for the purpose of testing which incarnation of perl some module fails in ), testing against a perl that was previously tested against in a previous bisect should return a cached result, greatly speeding up the bisect ( at the expense of disk space ).



        cache_root => '/some/path',
        git_root   => '/some/path/to/perl/git',
        persistent => bool,
        preclean   => bool,
        quiet      => bool,
        log_output => filehandle,
        log        => coderef,
  • cache_root

    path. This should be a path to an existent base working directory to install multiple perl installs to

    Perl builds will either be in the form of




    depending on persistent

  • git_root


    This should be a path to an existing perl git checkout.

  • persistent


    Whether to make the build directory persistent or not. Persistent directories can be optimistically re-used, while non-persistent ones can not.

    Non Persistent directories also have a random component added to their path, and implied cleanup on exit.

    Default is NOT PERSISTENT

  • preclean


    Whether to execute a pre-build cleanup of the git working directory.

    This at present executes a mash of git checkout, git reset and git clean.

    Default is PRE-CLEAN GIT TREE

  • quiet


    If specified, the default method for log is a no-op.

    The default is NOT QUIET

  • log_output


    Destination to write log messages to.

    Default is *STDERR

  • log

    coderef. Handles dispatch from logging mechanisms, in the form

        $logger->( $color_spec , @message );

    where color_spec is anything that Term::ANSIColor::colored understands.

        $logger->( ['red'], "this", "is", "a" , "test" );

    Default implementation writes to log_output formatting @message via Term::ANSIColor.


Kent Fredric <>


This software is copyright (c) 2013 by Kent Fredric <>.

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