@@ -27,15 +27,20 @@ sub update_bugzilla {
27
27
server => $cfg -> {bugzilla }{server },
28
28
email => $cfg -> {bugzilla }{user },
29
29
password => $cfg -> {bugzilla }{pass },
30
+ use_ssl => 1,
30
31
bug_number => $set -> {bug }
31
32
) || croak " Cannot open bz - $! " ;
32
33
33
- my $header = sprintf ( " Git commit: %s /commitdiff/%s \n " , $cfg -> {gitweb }, $info -> {rev } );
34
+ my $header =
35
+ sprintf ( " Git commit: %s /commitdiff/%s \n " , $cfg -> {gitweb }, $info -> {rev } );
34
36
if ( scalar ( @{ $info -> {diff } } ) > 50 ) {
35
37
36
38
# big diff - we skip the diff
37
39
$bz -> additional_comments(
38
- join ( " \n " , $header , @{ $info -> {info } }, ' ' , @{ $info -> {log } }, ' ----' , @{ $info -> {diffstat } } ) );
40
+ join ( " \n " ,
41
+ $header , @{ $info -> {info } }, ' ' ,
42
+ @{ $info -> {log } }, ' ----' , @{ $info -> {diffstat } } )
43
+ );
39
44
}
40
45
else {
41
46
@@ -48,7 +53,9 @@ sub update_bugzilla {
48
53
49
54
$bz -> commit;
50
55
51
- printf ( " [%d ] %s %s [%s ]\n " , $set -> {bug }, $info -> {rev }, $info -> {log }[0], $set -> {action } );
56
+ printf ( " [%d ] %s %s [%s ]\n " ,
57
+ $set -> {bug }, $info -> {rev }, $info -> {log }[0], $set -> {action } )
58
+ if ($verbose );
52
59
}
53
60
54
61
# ------------------------------------------------------------------------
@@ -61,7 +68,9 @@ sub find_bugzilla_references {
61
68
my $bugid ;
62
69
foreach my $line ( @{ $info -> {log } } ) {
63
70
$line = lc ($line );
64
- if ( $line =~ / (closes|fixes|references):?\s *(?:bug(?:zilla|s)?)?\s *\# ?(\d +)/ ) {
71
+ if ( $line =~
72
+ / (closes|fixes|references):?\s *(?:bug(?:zilla|s)?)?\s *\# ?(\d +)/ )
73
+ {
65
74
$action = $1 ;
66
75
$bugid = $2 ;
67
76
}
@@ -76,7 +85,8 @@ sub find_bugzilla_references {
76
85
# remap actions
77
86
78
87
push ( @results , { bug => $bugid , action => $action } );
79
- # #printf( "%s\n\taction = %s bugid = %s\n", $info->{rev}, $action, $bugid );
88
+ printf ( " %s \n\t action = %s bugid = %s \n " ,
89
+ $info -> {rev }, $action , $bugid );
80
90
}
81
91
return @results ;
82
92
}
@@ -87,7 +97,9 @@ sub git_commit_info {
87
97
my $git = shift ;
88
98
my $rev = shift ;
89
99
90
- my @lines = $git -> run( ' show' , ' -M' , ' -C' , ' --patch-with-stat' , ' --pretty=fuller' , $rev );
100
+ my @lines =
101
+ $git -> run( ' show' , ' -M' , ' -C' , ' --patch-with-stat' , ' --pretty=fuller' ,
102
+ $rev );
91
103
92
104
my $info = {
93
105
rev => $rev ,
@@ -130,7 +142,8 @@ sub walk_git_commits {
130
142
131
143
return if ( $lastrev eq $headrev );
132
144
133
- my @revs = $git -> run( ' rev-list' , ' --topo-order' , ' --no-merges' , ( $lastrev . ' ..' . $headrev ) );
145
+ my @revs = $git -> run( ' rev-list' , ' --topo-order' , ' --no-merges' ,
146
+ ( $lastrev . ' ..' . $headrev ) );
134
147
135
148
foreach my $rev ( reverse (@revs ) ) {
136
149
my $info = git_commit_info( $git , $rev );
@@ -157,16 +170,24 @@ sub walk_git_commits {
157
170
' verbose!' => \$verbose ,
158
171
) or die " Incorrect options" ;
159
172
die " No config file given\n " unless ( $config and -f $config );
160
- my $cfg = ( values ( %{ Config::Any-> load_files( { files => [$config ], use_ext => 1 } )-> [0] } ) )[0];
173
+ my $cfg = (
174
+ values (
175
+ %{ Config::Any-> load_files( { files => [$config ], use_ext => 1 } )
176
+ -> [0]
177
+ }
178
+ )
179
+ )[0];
161
180
162
181
die " No git_dir specified\n " unless ( $cfg -> {git_dir } );
163
182
$cfg -> {lasttag } ||= $cfg -> {git_dir } . ' /refs/tags/BugzillaDone' ;
164
183
$cfg -> {branch_head } ||= ' HEAD' ;
165
184
166
- $cfg -> {lastref } = -f $cfg -> {lasttag } ? read_file( $cfg -> {lasttag } ) : ' HEAD' ;
185
+ $cfg -> {lastref } =
186
+ -f $cfg -> {lasttag } ? read_file( $cfg -> {lasttag } ) : ' HEAD' ;
167
187
chomp ( $cfg -> {lastref } );
168
188
169
- my $git = Git::Repository-> new( git_dir => $cfg -> {git_dir } ) || die " No valid git repo\n " ;
189
+ my $git = Git::Repository-> new( git_dir => $cfg -> {git_dir } )
190
+ || die " No valid git repo\n " ;
170
191
171
192
my $newlast = walk_git_commits( $git , $cfg );
172
193
if ($newlast ) {
0 commit comments