line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Group::Git::Cmd::Status; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Created on: 2013-05-06 21:57:07 |
4
|
|
|
|
|
|
|
# Create by: Ivan Wills |
5
|
|
|
|
|
|
|
# $Id$ |
6
|
|
|
|
|
|
|
# $Revision$, $HeadURL$, $Date$ |
7
|
|
|
|
|
|
|
# $Revision$, $Source$, $Date$ |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1004
|
use Moo::Role; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
9
|
|
10
|
1
|
|
|
1
|
|
2969
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
11
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
12
|
1
|
|
|
1
|
|
5
|
use version; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
13
|
1
|
|
|
1
|
|
79
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
84
|
|
14
|
1
|
|
|
1
|
|
20
|
use English qw/ -no_match_vars /; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
15
|
1
|
|
|
1
|
|
449
|
use File::chdir; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
77
|
|
16
|
1
|
|
|
1
|
|
7
|
use Getopt::Alt; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = version->new('0.7.7'); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
requires 'repos'; |
21
|
|
|
|
|
|
|
requires 'verbose'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $opt = Getopt::Alt->new( |
24
|
|
|
|
|
|
|
{ help => __PACKAGE__, }, |
25
|
|
|
|
|
|
|
[ |
26
|
|
|
|
|
|
|
'quiet|q', |
27
|
|
|
|
|
|
|
] |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub status_start { |
31
|
0
|
|
|
0
|
1
|
|
local $ARGV; |
32
|
0
|
|
|
|
|
|
$opt->process; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub status { |
38
|
0
|
|
|
0
|
1
|
|
my ($self, $name) = @_; |
39
|
0
|
0
|
|
|
|
|
return unless -d $name; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $repo = $self->repos->{$name}; |
42
|
0
|
|
|
|
|
|
my $cmd; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
local $CWD = $name; |
45
|
0
|
|
|
|
|
|
$cmd = join ' ', 'git', 'status', map { $self->shell_quote } @ARGV; |
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
my $out = `$cmd 2>&1`; |
48
|
|
|
|
|
|
|
|
49
|
0
|
0
|
|
|
|
|
return $out if $self->verbose; |
50
|
|
|
|
|
|
|
|
51
|
0
|
0
|
0
|
|
|
|
return if $out =~ /nothing \s+ to \s+ commit/xms && $opt->opt->quiet; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
return $out; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Group::Git::Cmd::Status - Runs git status on a git project |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 VERSION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This documentation refers to Group::Git::Cmd::Status version 0.7.7. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 SYNOPSIS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
use Group::Git::Cmd::Status; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Brief but working code example(s) here showing the most common usage(s) |
74
|
|
|
|
|
|
|
# This section will be as far as many users bother reading, so make it as |
75
|
|
|
|
|
|
|
# educational and exemplary as possible. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 DESCRIPTION |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=over 4 |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item C<status ($name)> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Runs git status on each directory if the status message includes: |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
"nothing to commit" |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
The status is suppressed to keep the output clean. This can be overridden |
91
|
|
|
|
|
|
|
if verbose is set. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item C<status_start ()> |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Process the command line arguments for status |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=back |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 CONFIGURATION AND ENVIRONMENT |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
There are no known bugs in this module. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Please report problems to Ivan Wills (ivan.wills@gmail.com). |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Patches are welcome. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 AUTHOR |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Ivan Wills - (ivan.wills@gmail.com) |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Copyright (c) 2013 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). |
122
|
|
|
|
|
|
|
All rights reserved. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify it under |
125
|
|
|
|
|
|
|
the same terms as Perl itself. See L<perlartistic>. This program is |
126
|
|
|
|
|
|
|
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
127
|
|
|
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
128
|
|
|
|
|
|
|
PARTICULAR PURPOSE. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=cut |