Hi Kendy, I'm attaching a patch that updates the cia bot so that you don't need to manually disable it on each merge. ;) OK to push? (More importantly, if I push it, it would be nice if you could restart the bot, as I guess that's not automatic. :) ) Thanks.
From 53a5563a0b4df6a45d73bc80be6927b06556e573 Mon Sep 17 00:00:00 2001 From: Miklos Vajna <vmiklos@frugalware.org> Date: Fri, 26 Nov 2010 01:27:46 +0100 Subject: [PATCH] run-libreoffice-ciabot: avoid flood on merges Check if the last hash is a merge commit: if yes, then just announce the last one, otherwise do the usual "announce any commit since the last one" dance. --- scratch/cia/run-libreoffice-ciabot.pl | 26 +++++++++++++++++--------- 1 files changed, 17 insertions(+), 9 deletions(-) diff --git a/scratch/cia/run-libreoffice-ciabot.pl b/scratch/cia/run-libreoffice-ciabot.pl index bc8c0aa..0c6f892 100644 --- a/scratch/cia/run-libreoffice-ciabot.pl +++ b/scratch/cia/run-libreoffice-ciabot.pl @@ -44,16 +44,24 @@ sub report($$$) { if ( defined( $old_head ) ) { if ( $old_head ne $new_head ) { - if ( open COMMITS, "git rev-list $new_head ^$old_head | tac |" ) { - while ( <COMMITS> ) { - chomp; - print "Sending report about $_ in $key\n"; - qx(libreoffice-ciabot.pl $repo $_ $branch_name) + my $ret = system("git rev-parse -q --verify $new_head^2 >/dev/null"); + if ($ret != 0) { + # not a merge commit, announce every commit + if ( open COMMITS, "git rev-list $new_head ^$old_head | tac |" ) { + while ( <COMMITS> ) { + chomp; + print "Sending report about $_ in $key\n"; + qx(libreoffice-ciabot.pl $repo $_ $branch_name) + } + close COMMITS; } - close COMMITS; - } - else { - error( "Cannot call git rev-list." ); + else { + error( "Cannot call git rev-list." ); + } + } else { + # just process the merge commit itself + print "Sending report about $new_head in $key\n"; + qx(libreoffice-ciabot.pl $repo $new_head $branch_name) } } } -- 1.7.3.2
Attachment:
pgp5bYOb80xAv.pgp
Description: PGP signature