Add a script to list the fixed issues from GoogleCode's 'updates' link
[msysgit.git] / share / msysGit / googlecode-changes.perl
blob2486bf3ee8090850b81cebde661332768a3d8026
1 #!/usr/bin/perl
3 if (@ARGV != 1) {
4 print STDERR <<EOF;
5 Usage: <script> <date-or-commit>
6 EOF
7 exit(1);
10 use Date::Parse;
11 use HTML::Entities;
13 my $since = `git show -s --format=%ct $ARGV[0]^0 2> /dev/null`;
14 chomp($since);
15 if ($since eq '') {
16 $since = str2time($ARGV[0]);
19 $url = 'http://code.google.com/p/msysgit/updates/list?num=50&start=';
21 my ($offset, $date, $issue, $oneline);
23 sub get_fixes ($) {
24 $offset = shift;
26 open IN, 'curl -s "' . $url . $offset . '" |';
27 while (<IN>) {
28 if (/<span class="date below-more" title="([^"]+)"/) {
29 $date = str2time($1);
30 if ($date < $since) {
31 close IN;
32 return 0;
35 elsif (/<a class="ot-issue-link" [^>]*>([^<]+)</) {
36 $issue = $1;
37 $_ = <IN>;
38 if (/^\s*\((.+)\) Status changed/) {
39 $oneline = decode_entities($1);
40 while (<IN>) {
41 if (/^<\/div>/) {
42 last;
44 if (/<span class="ot-issue-field-value">Fixed<\/span>/) {
45 print "Issue $issue ($oneline) was fixed\n";
51 close IN;
52 return 1;
55 for (my $off = 0; $off < 250 && get_fixes($off); $off += 50) {
56 # do nothing