Re: [Libreoffice] [PATCH] run-libreoffice-ciabot: avoid flood on merges

2010-11-26 Thread Miklos Vajna
On Fri, Nov 26, 2010 at 09:15:46AM +0100, Jan Holesovsky  wrote:
> Nice - please go ahead and push, and tell me when done; indeed, it is
> not automatic ;-)

I just pushed it.


pgp1Cdpa8mHYM.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH] run-libreoffice-ciabot: avoid flood on merges

2010-11-26 Thread Jan Holesovsky
Hi Miklos,

On 2010-11-26 at 01:33 +0100, Miklos Vajna wrote:

> 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. :) )

Nice - please go ahead and push, and tell me when done; indeed, it is
not automatic ;-)

Thank you,
Kendy

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] run-libreoffice-ciabot: avoid flood on merges

2010-11-25 Thread Miklos Vajna
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 
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 (  ) {
-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 (  ) {
+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



pgpLxiTAJhV9T.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice