[git] commit karma.git: hooks/post-receive.mail lib/Git/PostReceiveHook.php
| From: | Derick Rethans | Date: | Tue, 20 Mar 2012 08:42:53 +0000 |
| Subject: | [git] commit karma.git: hooks/post-receive.mail lib/Git/PostReceiveHook.php | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-68034@lists.php.net to get a copy of this message | ||
Commit: eb514083bf2a6ddaa0f2404da3d4347d2747a22e
Author: Derick Rethans(github@derickrethans.nl) Tue, 20 Mar 2012 07:50:06 +0000
Committer: Derick Rethans(github@derickrethans.nl) Tue, 20 Mar 2012 07:54:58 +0000
Parents: 42d233ae4752adbce2709553cef0cd456b92a2e0
Link: http://git.php.net/?p=karma.git;a=commitdiff;h=eb514083bf2a6ddaa0f2404da3d4347d2747a22e
Log:
Don't use an email prefix unless specifically configured.
This gets rid of the superfluous "[git] " in every mail subject to PHP-CVS.
Changed paths:
M hooks/post-receive.mail
M lib/Git/PostReceiveHook.php
Diff:
eb514083bf2a6ddaa0f2404da3d4347d2747a22e
diff --git a/hooks/post-receive.mail b/hooks/post-receive.mail
index 7d47619..de24b77 100755
--- a/hooks/post-receive.mail
+++ b/hooks/post-receive.mail
@@ -30,7 +30,10 @@ include 'Git/PostReceiveHook.php';
$recipients = exec('git config hooks.mailinglist');
-$emailPrefix = exec('git config hooks.emailprefix') ?: '[git]';
+$emailPrefix = exec('git config hooks.emailprefix');
+if ($emailprefix != '') {
+ $emailprefix . ' ';
+}
$user = null;
if (getenv('REMOTE_USER')) {
diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index bd3be9b..4aec7b7 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -229,7 +229,7 @@ class PostReceiveHook extends ReceiveHook
$mail = new \Mail();
- $mail->setSubject($this->emailPrefix . ' branch ' .
$this->getRepositoryName() . ': ' . $status[$changeType] . ' branch ' .
$shortname);
+ $mail->setSubject($this->emailPrefix . 'branch ' .
$this->getRepositoryName() . ': ' . $status[$changeType] . ' branch ' .
$shortname);
$message = 'Branch ' . $shortname . ' in ' .
$this->getRepositoryName() . ' was ' . $status[$changeType] . 'd' .
"\n";
$message .= 'Date: ' . date('r') . "\n";
@@ -567,7 +567,7 @@ class PostReceiveHook extends ReceiveHook
$diff = \Git::gitExec('diff-tree -c -p %s', escapeshellarg($revision));
$mail = new \Mail();
- $mail->setSubject($this->emailPrefix . ' commit ' .
$this->getRepositoryName() . ': ' . implode(' ', array_keys($paths)));
+ $mail->setSubject($this->emailPrefix . 'commit ' .
$this->getRepositoryName() . ': ' . implode(' ', array_keys($paths)));
$message = '';