[Libreoffice-commits] .: scratch/cia

Miklos Vajna vmiklos at kemper.freedesktop.org
Fri Nov 26 03:56:24 PST 2010


 scratch/cia/run-libreoffice-ciabot.pl |   26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 53a5563a0b4df6a45d73bc80be6927b06556e573
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Fri Nov 26 01:27:46 2010 +0100

    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.

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)
                 }
             }
         }


More information about the Libreoffice-commits mailing list