App-Git-Workflow

 view release on metacpan or  search on metacpan

lib/App/Git/Workflow/Command/BranchClean.pm  view on Meta::CPAN

    my $too_old = too_old($details);
    my $in_master;

    if (!$too_old) {
        $in_master = in_master($details);
    }

    if ( $in_master || $too_old ) {
        warn 'deleting ' . ($in_master ? 'merged' : 'old') . " branch $branch\n";

        my ($remote, $name) = $branch =~ m{/} ? split m{/}, $branch, 2 : (undef, $branch);

        if ( $option{tag} ) {
            my $tag = $option{tag_prefix} . $name . $option{tag_suffix};
            $workflow->git->tag(qw/-a -m /, "Converting '$name' to the tag '$tag'", $tag) if !$option{test};
        }

        if ( !$option{test} ) {
            if ($remote) {
                eval {
                    $workflow->git->push($remote, '--no-verify', ":refs/heads/$name");

lib/App/Git/Workflow/Command/Recent.pm  view on Meta::CPAN

    my %changed;
    my $count = 0;
    print {*STDERR} '.' if $option{verbose};

    for my $sha (@commits) {
        my $changed = $workflow->commit_details($sha, branches => 1, files => 1, user => 1);
        next if $self->ignore($changed);

        for my $type (keys %{ $changed->{files} }) {
            if ( defined $option{depth} ) {
                $type = join '/', grep {defined $_} (split m{/}, $type)[0 .. $option{depth} - 1];
            }
            if ( defined $option{path_depth} ) {
                for my $path (keys %{ $option{path_depth} }) {
                    if ( $type =~ /^$path/ ) {
                        $type = join '/', grep {defined $_} (split m{/}, $type)[0 .. $option{path_depth}{$path} - 1];
                    }
                }
            }
            my %branches;
            if ( $option{remote} ) {
                %branches = map { $_ => 1 } grep {/^origin/} keys %{ $changed->{branches} };
            }
            elsif ( $option{all} ) {
                %branches = %{ $changed->{branches} };
            }



( run in 0.968 second using v1.01-cache-2.11-cpan-9288abcf80b )