git logs
authorJason Etheridge <jason@esilibrary.com>
Mon, 12 Aug 2013 20:17:30 +0000 (16:17 -0400)
committerJason Etheridge <jason@esilibrary.com>
Mon, 12 Aug 2013 20:17:30 +0000 (16:17 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
qa/test_output_webifier.pl

index 750d2b9..21df331 100755 (executable)
@@ -1,5 +1,8 @@
 #!/usr/bin/perl
 
+# This script assumes git checkouts at ~/git/Evergreen and ~/git/OpenSRF that
+# correspond to branches used to produce the test output being parsed.
+
 my $state = 'skipping';
 my $error_count = 0;
 my $subpage_count = 0;
@@ -122,13 +125,27 @@ sub print_pass_or_fail {
 sub branch_tips {
     my $html = "<h2>Current OpenSRF tip:</h2>\n<pre>$opensrf_tip</pre>\n";
     $html .= "<h2>Current Evergreen tip:</h2>\n<pre>$evergreen_tip</pre>\n";
-    `touch prev_tips.txt`;
-    my $prev = `cat prev_tips.txt`;
-    $prev =~ s/<h2>Current /<h2> Previous /g;
-    open TIP_FILE, "> prev_tips.txt";
-    print TIP_FILE $html;
-    close TIP_FILE;
-    $html .= $prev;
+    my $opensrf_tip_hash = '';
+    if ($opensrf_tip =~ /^(\S+)\s/) {
+        $opensrf_tip_hash = $1;
+    }
+    my $evergreen_tip_hash = '';
+    if ($evergreen_tip =~ /^(\S+)\s/) {
+        $evergreen_tip_hash = $1;
+    }
+    `touch prev_evergreen_tip.hash`;
+    `touch prev_opensrf_tip.hash`;
+    my $prev_opensrf_tip_hash = `cat prev_opensrf_tip.hash`;
+    chop $prev_opensrf_tip_hash;
+    my $prev_evergreen_tip_hash = `cat prev_evergreen_tip.hash`;
+    chop $prev_evergreen_tip_hash;
+    $html .= "<h2>OpenSRF commits since last build:</h2>\n<pre>";
+    $html .= `cd ~/git/OpenSRF/ ; git fetch 2> /dev/null ; git log --format=oneline $prev_opensrf_tip_hash..$opensrf_tip_hash`;
+    $html .= "</pre><h2>Evergreen commits since last build:</h2>\n<pre>";
+    $html .= `cd ~/git/Evergreen/ ; git fetch 2> /dev/null ; git log --format=oneline $prev_evergreen_tip_hash..$evergreen_tip_hash`;
+    `echo $opensrf_tip_hash > prev_opensrf_tip.hash`;
+    `echo $evergreen_tip_hash > prev_evergreen_tip.hash`;
+    $html .= "</pre>\n";
     return $html;
 }