This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository fateserver.

commit f79644763bcc47bd0992411697e650b67044f11d
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Mon Aug 10 20:27:28 2026 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Mon Aug 10 20:27:28 2026 +0200

    log: compare warnings instead of diffing build logs
    
    Parallel make interleaves the output differently on every run, so diffing
    two build logs reported hundreds of changed lines between builds that
    differed in nothing.
    
    Add a 'warnings' view over the logs the count in the index covers, listing
    one line per warning, and compare those as a multiset so only the ones
    added or removed are reported.  Point the count and comparison links in the
    index at it.  Raw logs, and raw diffs between them, are unchanged.
    
    Signed-off-by: Kacper Michajłow <[email protected]>
---
 index.cgi |  4 ++--
 log.cgi   | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+), 2 deletions(-)

diff --git a/index.cgi b/index.cgi
index 8e21700..752e4ae 100755
--- a/index.cgi
+++ b/index.cgi
@@ -306,13 +306,13 @@ for my $rep (sort repcmp @reps) {
     start 'td', class => "$walert";
     start 'div', class => 'pull-left';
     anchor $$rep{nwarn},
-        href => href slot => $$rep{slot}, time => $$rep{date}, log => 
'compile';
+        href => href slot => $$rep{slot}, time => $$rep{date}, log => 
'warnings';
     end;
     if (defined $$rep{pdate}) {
         start 'div', class => 'pull-right';
         anchor '±',
             href => href slot => $$rep{slot}, time => $$rep{date},
-            log => "compile/$$rep{pdate}";
+            log => "warnings/$$rep{pdate}";
         end;
     }
     end;
diff --git a/log.cgi b/log.cgi
index 8e41c7b..159094e 100755
--- a/log.cgi
+++ b/log.cgi
@@ -23,6 +23,32 @@ use FATE;
 
 cgi_path_is_trustworthy;
 
+# Logs the warning count in fate-recv.sh covers.
+my @warn_logs = qw/compile/;
+
+# Count each distinct warning line in the @names logs of a report, same as
+# fate-recv.sh. Only the warning line is kept to make it readable.
+sub warnings_in {
+    my ($dir, @names) = @_;
+    my %count;
+    my $found = 0;
+
+    for my $name (@names) {
+        my $file = "$dir/$name.log.gz";
+        next if not -r $file;
+        open my $fh, '-|', 'zcat', $file or next;
+        $found = 1;
+        while (<$fh>) {
+            chomp;
+            s/\r$//;
+            $count{$_}++ if /\bwarning\b/i;
+        }
+        close $fh;
+    }
+
+    return $found ? \%count : undef;
+}
+
 my $req_slot = safeparam_slot;
 my $req_time = safeparam_time;
 my $req_log = safeparam_log;
@@ -34,6 +60,57 @@ my $log = "$repdir/$req_log.log.gz";
 
 print "Content-type: text/plain\r\n";
 
+# 'warnings' is not a log of its own but a view of the ones the count covers.
+# Raw logs, and raw diffs between them, are still served below.
+if ($req_log eq 'warnings') {
+    my $new = warnings_in($repdir, @warn_logs);
+
+    if (not $new) {
+        print "Status: 404 Not Found\r\n\r\n";
+        print "No logs to take warnings from in $req_time\n";
+        exit;
+    }
+
+    if (not $req_diff) {
+        end_headers_and_compress;
+        for my $w (sort keys %$new) {
+            printf "%s%s\n", $$new{$w} > 1 ? '(x' . $$new{$w} . ') ' : '', $w;
+        }
+        exit;
+    }
+
+    my $old = warnings_in("$fatedir/$req_slot/$req_diff", @warn_logs);
+
+    if (not $old) {
+        print "Status: 404 Not Found\r\n\r\n";
+        print "No logs to compare against in $req_diff\n";
+        exit;
+    }
+
+    my ($nold, $nnew) = (0, 0);
+    $nold += $_ for values %$old;
+    $nnew += $_ for values %$new;
+
+    end_headers_and_compress;
+
+    print "--- $req_diff $req_log\n";
+    print "+++ $req_time $req_log\n";
+    print "$nold warnings -> $nnew warnings\n\n";
+
+    my %all = (%$old, %$new);
+    my $changed = 0;
+    for my $w (sort keys %all) {
+        my $delta = ($$new{$w} || 0) - ($$old{$w} || 0);
+        next if not $delta;
+        $changed++;
+        printf "%s%s%s\n", $delta > 0 ? '+' : '-',
+                           abs($delta) > 1 ? '(x' . abs($delta) . ') ' : '', 
$w;
+    }
+
+    print "No change in warnings.\n" if not $changed;
+    exit;
+}
+
 if (! -r $log) {
     print "Status: 404 Not Found\r\n\r\n";
     print "Invalid log '$req_log' requested\n";

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to