line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::whatthecommit; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
816
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
33
|
use 5.008_005; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
48
|
|
5
|
1
|
|
|
1
|
|
14
|
use base 'Exporter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
287
|
|
6
|
|
|
|
|
|
|
our @EXPORT_OK = qw(goodie); |
7
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
8
|
|
|
|
|
|
|
our $HOOK |
9
|
|
|
|
|
|
|
= 'echo $(curl -L http://whatthecommit.com/ 2>/dev/null | grep -Po \'(?<=\ ).*$\') > "$1"'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub goodie($) { |
12
|
0
|
|
|
0
|
0
|
|
my $git = shift; |
13
|
0
|
|
|
|
|
|
my $prepare_commit_msg = $git . "/.git/hooks/prepare-commit-msg"; |
14
|
0
|
0
|
|
|
|
|
open my $REPO, ">$prepare_commit_msg" |
15
|
|
|
|
|
|
|
or die( print "Cannot open $prepare_commit_msg\n" ); |
16
|
0
|
|
|
|
|
|
print $REPO $HOOK; |
17
|
0
|
|
|
|
|
|
close $REPO; |
18
|
0
|
|
|
|
|
|
chmod 0755, $prepare_commit_msg; |
19
|
0
|
|
|
|
|
|
print "[$git] You are good to go, try to commit in your repo now\n"; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
__END__ |