From a63dde634310b9d7616b324a4fcf327059c9dbd7 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Mon, 10 Jan 2011 12:37:59 -0800 Subject: [PATCH] Compact git logs and provide changeset links to github. --- cgi-bin/show_log.pl | 9 +++----- templates/log.tt | 56 ++++++++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/cgi-bin/show_log.pl b/cgi-bin/show_log.pl index 68ffa3d..9173f5b 100755 --- a/cgi-bin/show_log.pl +++ b/cgi-bin/show_log.pl @@ -187,7 +187,7 @@ sub process_changed my @changed_rows; my %commits; my @commit_logs; - my $gitcmd = "TZ=UTC GIT_DIR=$local_git_clone git log --stat --date=local"; + my $gitcmd = "TZ=UTC GIT_DIR=$local_git_clone git log --date=local"; foreach (@lines) { next if ($scm eq 'cvs' and ! m!^(pgsql|master|REL\d_\d_STABLE)/!); @@ -196,17 +196,14 @@ sub process_changed } if ($git_from && $git_to) { - my $format = - 'commit %H%nAuthor: %cN <%ce>%nDate: %cd UTC%n%n%w(80,4,4)%s%n%n%b%n'; + my $format = 'commit %h %cd UTC%w(160,2,2)%s'; my $gitlog = `$gitcmd --pretty=format:"$format" $git_from..$git_to 2>&1`; @commit_logs = split(/(?=^commit)/m,$gitlog) } else { # normally we expect to have the git refs. this is just a fallback. - my $format = - 'epoch: %at%ncommit %H%nAuthor: %cN <%ce>%nDate: %cd UTC%n%n' . - '%w(80,4,4)%s%n%n%b%n'; + my $format = 'epoch: %at%ncommit %h %cd UTC%w(160,2,2)%s'; foreach my $commit ( keys %commits ) { my $commitlog = diff --git a/templates/log.tt b/templates/log.tt index 07699b0..c5d275a 100644 --- a/templates/log.tt +++ b/templates/log.tt @@ -26,18 +26,11 @@ See accompanying License file for license details pagebutton = 'none' %] [%- BLOCK gitlog ; - loglines = clog.split('\n'); - firstline = loglines.shift; - commitref = firstline.replace('commit ([0-9A-Fa-f]+)','$1'); -%] - -commit [% commitref %] -[% loglines.join("\n") | html %] + commitref = clog.replace('commit ([0-9A-Fa-f]+)(.|\n)*','$1'); + logtail = clog.replace('commit ([0-9A-Fa-f]+)',''); + logtail = logtail.replace('\n',' '); +%][% commitref %][% logtail | html %] [% END -%]

PostgreSQL Build Farm Log

Details for system "[% system %]"[% IF stage != 'OK' %] failure at stage [% stage ; ELSE %], status 'OK'[% END %], snapshot taken [% urldt %]

@@ -95,6 +88,9 @@ commit [% commitref %]
 [% conf | html %]
 
+ + + + [%- ELSE %] -
 not recorded
 
+ [% END -%] + [% IF stage != 'OK' %] + + + [%- ELSE %]
 not recorded
 
+ [% END -%] + [% END %] +

Files changed this run

[%- IF changed_this_run.0 -%]
@@ -103,21 +99,26 @@ commit [% commitref %]
 [%- END -%]
 
[% END %] +
[% IF changed_this_run_logs.0 %]
Git log
-
-[%- FOREACH clog IN changed_this_run_logs ; PROCESS gitlog -%]
-[%IF not loop.last %]
-===================================================================
-[% END -%]
+
+Change Set for this build
+
+[% FOREACH clog IN changed_this_run_logs ; PROCESS gitlog -%]
 [%- END -%]
-
+ +

Files changed since last success

[%- IF changed_since_success.0 %]
@@ -126,21 +127,28 @@ not recorded
 [%- END -%]
 
[% END %] +
[% IF changed_since_success_logs.0 %]
Git log
-
-[%- FOREACH clog IN changed_since_success_logs ; PROCESS gitlog -%]
-[%IF not loop.last %]
-===================================================================
-[% END -%]
+
+Change Set prior to this build
+
+Change Set including this build
+
+[% FOREACH clog IN changed_since_success_logs ; PROCESS gitlog -%]
 [%- END -%]
-
+ +

Log

 [% log | html %]
-- 
2.30.2