Commit:    7b8230a7dff0f8b04b92a6ab481964513afced03
Author:    David Soria Parra <d...@php.net>         Tue, 20 Mar 2012 18:43:23 
+0100
Parents:   9017e6f22c422a2b3a9f1677e514893ea096cb7e

Branches:   refs/heads/master

Link:       
http://git.php.net/?p=karma.git;a=commitdiff;h=7b8230a7dff0f8b04b92a6ab481964513afced03

Log:
Omit trivial merges

Changed paths:
  M  lib/Git/PostReceiveHook.php


Diff:
7b8230a7dff0f8b04b92a6ab481964513afced03
diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index 155797c..89e0a45 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -527,9 +527,9 @@ class PostReceiveHook extends ReceiveHook
         }
 
 
-        if ($pathsString == '') {
-            $message .= "\nTrivial merge\n";
-        } elseif (strlen($pathsString) < 8192) {
+        $isTrivialMerge = empty($pathsString);
+
+        if (!$isTrivalMerge && strlen($pathsString) < 8192) {
             // inline changed paths
             $message .= "\nChanged paths:\n" . $pathsString . "\n";
             if ((strlen($pathsString) + strlen($diff)) < 8192) {
@@ -564,18 +564,20 @@ class PostReceiveHook extends ReceiveHook
             }
         }
 
-        $mail->setMessage($message);
+        if (!$isTrivialMerge) {
+            $mail->setMessage($message);
 
-        $mail->setFrom($this->pushAuthor . '@php.net', $this->pushAuthorName);
-        $mail->addTo($this->mailingList);
+            $mail->setFrom($this->pushAuthor . '@php.net', 
$this->pushAuthorName);
+            $mail->addTo($this->mailingList);
 
-        foreach ($branches as $branch) {
-            if (isset($this->branchesMailIds[$branch])) {
-                $mail->addReplyTo($this->branchesMailIds[$branch]);
+            foreach ($branches as $branch) {
+                if (isset($this->branchesMailIds[$branch])) {
+                    $mail->addReplyTo($this->branchesMailIds[$branch]);
+                }
             }
-        }
 
-        $mail->send();
+            $mail->send();
+        }
     }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to