| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::GitGot::Command::gc; |
|
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:GENEHACK'; |
|
3
|
|
|
|
|
|
|
$App::GitGot::Command::gc::VERSION = '1.337'; |
|
4
|
|
|
|
|
|
|
# ABSTRACT: Run the 'gc' command to garbage collect in git repos |
|
5
|
15
|
|
|
15
|
|
12454
|
use 5.014; |
|
|
15
|
|
|
|
|
63
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
15
|
|
|
15
|
|
10439
|
use Data::Dumper; |
|
|
15
|
|
|
|
|
108692
|
|
|
|
15
|
|
|
|
|
1238
|
|
|
8
|
15
|
|
|
15
|
|
130
|
use Try::Tiny; |
|
|
15
|
|
|
|
|
41
|
|
|
|
15
|
|
|
|
|
828
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
15
|
|
|
15
|
|
115
|
use Moo; |
|
|
15
|
|
|
|
|
41
|
|
|
|
15
|
|
|
|
|
113
|
|
|
11
|
|
|
|
|
|
|
extends 'App::GitGot::Command'; |
|
12
|
15
|
|
|
15
|
|
5513
|
use namespace::autoclean; |
|
|
15
|
|
|
|
|
38
|
|
|
|
15
|
|
|
|
|
125
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# incremental output looks nicer for this command... |
|
15
|
|
|
|
|
|
|
STDOUT->autoflush(1); |
|
16
|
2
|
|
|
2
|
|
9
|
sub _use_io_page { 0 } |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _execute { |
|
19
|
2
|
|
|
2
|
|
9
|
my( $self, $opt, $args ) = @_; |
|
20
|
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
20
|
my $max_len = $self->max_length_of_an_active_repo_label; |
|
22
|
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
41
|
REPO: for my $repo ( $self->active_repos ) { |
|
24
|
8
|
50
|
|
|
|
390
|
next REPO unless $repo->type eq 'git'; |
|
25
|
|
|
|
|
|
|
try { |
|
26
|
8
|
100
|
|
8
|
|
508
|
printf "%3d) %-${max_len}s : ", $repo->number , $repo->label unless $self->quiet; |
|
27
|
|
|
|
|
|
|
# really wish this gave _some_ kind of output... |
|
28
|
8
|
|
|
|
|
565
|
$repo->gc; |
|
29
|
8
|
100
|
|
|
|
160
|
printf "%s\n", $self->major_change( 'COLLECTED' ) unless $self->quiet; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
catch { |
|
32
|
0
|
|
|
0
|
|
|
say STDERR $self->error( 'ERROR: Problem with GC on repo ' , $repo->label ); |
|
33
|
0
|
|
|
|
|
|
say STDERR "\n" , Dumper $_; |
|
34
|
8
|
|
|
|
|
61
|
}; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
## FIXME docs |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |