Commit: 14bb87dbb769d3795797921014e4b9cc14da412f
Author: Derick Rethans <git...@derickrethans.nl>         Tue, 20 Mar 2012 
09:41:04 +0000
Committer: Derick Rethans <git...@derickrethans.nl>      Tue, 20 Mar 2012 
09:41:04 +0000
Parents: 01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2

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

Log:
Fold author and committer if they're the same and align items.

Changed paths:
  M  lib/Git/PostReceiveHook.php


Diff:
14bb87dbb769d3795797921014e4b9cc14da412f
diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index 60c0a33..16ef70a 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -150,11 +150,13 @@ class PostReceiveHook extends ReceiveHook
 
                 foreach ($revisions as $revision) {
                     $commitInfo = $this->getCommitInfo($revision);
-                    $logString .= 'Commit: ' . $revision . "\n";
-                    $logString .= 'Author: ' . $commitInfo['author'] . ' <' . 
$commitInfo['author_email'] . '>         ' . $commitInfo['author_date'] . "\n";
-                    $logString .= 'Committer: ' . $commitInfo['committer'] . ' 
<' . $commitInfo['committer_email'] . '>      ' . $commitInfo['committer_date'] 
. "\n";
-                    $logString .= "Link: http://git.php.net/?p="; . 
$this->getRepositoryName() . ";a=commitdiff;h=" . $revision . "\n";
-                    $logString .= "Shortlog: " . $commitInfo['subject'] . "\n";
+                    $logString .= 'Commit:    ' . $revision . "\n";
+                    $logString .= 'Author:    ' . $commitInfo['author'] . ' <' 
. $commitInfo['author_email'] . '>         ' . $commitInfo['author_date'] . 
"\n";
+                    if (($commitInfo['author'] != $commitInfo['committer']) || 
($commitInfo['author_email'] != $commitInfo['committer_email'])) {
+                        $logString .= 'Committer: ' . $commitInfo['committer'] 
. ' <' . $commitInfo['committer_email'] . '>      ' . 
$commitInfo['committer_date'] . "\n";
+                    }
+                    $logString .= 'Link:      http://git.php.net/?p=' . 
$this->getRepositoryName() . ";a=commitdiff;h=" . $revision . "\n";
+                    $logString .= 'Shortlog:  ' . $commitInfo['subject'] . 
"\n";
                     $logString .= "\n";
 
                 }
@@ -274,8 +276,8 @@ class PostReceiveHook extends ReceiveHook
             }
 
             if ($info['annotated']) {
-                $message .= 'Tag: ' . $info['revision'] . "\n";
-                $message .= 'Tagger: ' . $info['tagger'] . ' <' . 
$info['tagger_email'] . '>         ' . $info['tagger_date'] . "\n";
+                $message .= 'Tag:         ' . $info['revision'] . "\n";
+                $message .= 'Tagger:      ' . $info['tagger'] . ' <' . 
$info['tagger_email'] . '>         ' . $info['tagger_date'] . "\n";
                 $message .= "Log:\n" . $info['log'] . "\n";
             }
 
@@ -283,9 +285,11 @@ class PostReceiveHook extends ReceiveHook
             $message .= "Link: http://git.php.net/?p="; . 
$this->getRepositoryName() . ";a=tag;h=" . $info['revision'] . "\n";
             $message .= "\n";
 
-            $message .= 'Target: ' . $info['target'] . "\n";
-            $message .= 'Author: ' . $targetInfo['author'] . ' <' . 
$targetInfo['author_email'] . '>         ' . $targetInfo['author_date'] . "\n";
-            $message .= 'Committer: ' . $targetInfo['committer'] . ' <' . 
$targetInfo['committer_email'] . '>      ' . $targetInfo['committer_date'] . 
"\n";
+            $message .= 'Target:      ' . $info['target'] . "\n";
+            $message .= 'Author:      ' . $targetInfo['author'] . ' <' . 
$targetInfo['author_email'] . '>         ' . $targetInfo['author_date'] . "\n";
+            if (($targetInfo['author'] != $targetInfo['committer']) || 
($targetInfo['author_email'] != $targetInfo['committer_email'])) {
+                $message .= 'Committer:   ' . $targetInfo['committer'] . ' <' 
. $targetInfo['committer_email'] . '>      ' . $targetInfo['committer_date'] . 
"\n";
+            }
             if ($targetInfo['parents']) $message .= 'Parents: ' . 
$targetInfo['parents'] . "\n";
             $message .= "Target link: http://git.php.net/?p="; . 
$this->getRepositoryName() . ";a=commitdiff;h=" . $info['target'] . "\n";
             $message .= "Target log:\n" . $targetInfo['log'] . "\n";
@@ -506,12 +510,14 @@ class PostReceiveHook extends ReceiveHook
 
         $message = '';
 
-        $message .= 'Commit: ' . $revision . "\n";
-        $message .= 'Author: ' . $info['author'] . ' <' . 
$info['author_email'] . '>         ' . $info['author_date'] . "\n";
-        $message .= 'Committer: ' . $info['committer'] . ' <' . 
$info['committer_email'] . '>      ' . $info['committer_date'] . "\n";
-        if ($info['parents']) $message .= 'Parents: ' . $info['parents'] . 
"\n";
+        $message .= 'Commit:    ' . $revision . "\n";
+        $message .= 'Author:    ' . $info['author'] . ' <' . 
$info['author_email'] . '>         ' . $info['author_date'] . "\n";
+        if (($info['author'] != $info['committer']) || ($info['author_email'] 
!= $info['committer_email'])) {
+            $message .= 'Committer: ' . $info['committer'] . ' <' . 
$info['committer_email'] . '>      ' . $info['committer_date'] . "\n";
+        }
+        if ($info['parents']) $message .= 'Parents:   ' . $info['parents'] . 
"\n";
 
-        $message .= "\n" . "Link: http://git.php.net/?p="; . 
$this->getRepositoryName() . ";a=commitdiff;h=" . $revision . "\n";
+        $message .= "\n" . "Link:       http://git.php.net/?p="; . 
$this->getRepositoryName() . ";a=commitdiff;h=" . $revision . "\n";
 
         $message .= "\nLog:\n" . $info['log'] . "\n";


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

Reply via email to