[PHP-CVS] com karma: fix char's case problem: lib/Git/PostReceiveHook.php
Commit:0f4a8cdd72b0fabce293a9206db6b5710cbc9d76 Author:Alexander Moskaliov ir...@php.net Fri, 8 Jun 2012 17:36:47 +0400 Parents: f63ee4060239525713ba87016908d06fa75d903d Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=0f4a8cdd72b0fabce293a9206db6b5710cbc9d76 Log: fix char's case problem Changed paths: M lib/Git/PostReceiveHook.php Diff: diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index f43a160..336c4e9 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -486,7 +486,7 @@ class PostReceiveHook extends ReceiveHook $bugs = []; if (preg_match_all('/(?:(pecl|pear|php)\s*)?(?:bug|#)[\s#:]*([0-9]+)/iuX', $log, $matchedBugs, PREG_SET_ORDER)) { foreach($matchedBugs as $bug) { -$bugs[$bug[2]] = $bugUrlPrefixes[$bug[1]] . $bug[2]; +$bugs[$bug[2]] = $bugUrlPrefixes[strtolower($bug[1])] . $bug[2]; } } return $bugs; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Replace author by committer date in mail date header: lib/Git/PostReceiveHook.php
Commit:f63ee4060239525713ba87016908d06fa75d903d Author:Alexander Moskaliov ir...@php.net Tue, 1 May 2012 11:40:32 +0400 Parents: bc220ca91ec470baab210cb652c22f10abc689c6 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=f63ee4060239525713ba87016908d06fa75d903d Log: Replace author by committer date in mail date header Changed paths: M lib/Git/PostReceiveHook.php Diff: diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index e331101..f43a160 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -549,7 +549,7 @@ class PostReceiveHook extends ReceiveHook $mail = new \Mail(); $mail-setSubject($this-emailPrefix . 'com ' . $this-getRepositoryShortName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); -$mail-setTimestamp(strtotime($info['author_date'])); +$mail-setTimestamp(strtotime($info['committer_date'])); $message = ''; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix bug with new branch: lib/Git/BugsWebPostReceiveHook.php
Commit:661f83009aec570fffc1384bcffafbef25451818 Author:Alexander Moskaliov ir...@php.net Sat, 7 Apr 2012 14:45:22 +0400 Parents: 61cc09b1cbe8e3dcec3cf6b0447d942755c85a7c Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=661f83009aec570fffc1384bcffafbef25451818 Log: fix bug with new branch Changed paths: M lib/Git/BugsWebPostReceiveHook.php Diff: diff --git a/lib/Git/BugsWebPostReceiveHook.php b/lib/Git/BugsWebPostReceiveHook.php index fa4ebb7..8331ea7 100644 --- a/lib/Git/BugsWebPostReceiveHook.php +++ b/lib/Git/BugsWebPostReceiveHook.php @@ -45,13 +45,13 @@ class BugsWebPostReceiveHook extends ReceiveHook /* do we have heads? otherwise it's a new repo! */ $heads = implode(' ', $output); -$not = count($output) 0 ? sprintf('--not %s', escapeshellarg($heads)) : ''; +$not = count($output) 0 ? ' --not ' . implode(' ', $this-escapeArrayShellArgs($heads)) : ''; $cmd = sprintf( '%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s %s', \Git::GIT_EXECUTABLE, $repourl, -$not, -escapeshellarg($new) +escapeshellarg($new), +$not ); exec($cmd, $output); } elseif ($new != \Git::NULLREV) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] del karma: lib/Git/BugsWebPostReceiveHook.php
Branch: master Deleted commits count: 1 User: Alexander Moskaliov ir...@php.net Sat, 07 Apr 2012 10:52:07 + Changed paths: M lib/Git/BugsWebPostReceiveHook.php Diff: diff --git b/lib/Git/BugsWebPostReceiveHook.php a/lib/Git/BugsWebPostReceiveHook.php index 8331ea7..f96fe4a 100644 --- b/lib/Git/BugsWebPostReceiveHook.php +++ a/lib/Git/BugsWebPostReceiveHook.php @@ -41,10 +41,8 @@ class BugsWebPostReceiveHook extends ReceiveHook \Git::GIT_EXECUTABLE, $repourl ); -exec($cmd, $output); +exec($cmd, $heads); -/* do we have heads? otherwise it's a new repo! */ -$heads = implode(' ', $output); $not = count($output) 0 ? ' --not ' . implode(' ', $this-escapeArrayShellArgs($heads)) : ''; $cmd = sprintf( '%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s %s', -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix double bugs: lib/Git/BugsWebPostReceiveHook.php
Commit:bfef8080bed7733eef76800cf7960fdf67fead51 Author:Alexander Moskaliov ir...@php.net Sat, 7 Apr 2012 14:45:22 +0400 Parents: 61cc09b1cbe8e3dcec3cf6b0447d942755c85a7c Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=bfef8080bed7733eef76800cf7960fdf67fead51 Log: fix double bugs Changed paths: M lib/Git/BugsWebPostReceiveHook.php Diff: diff --git a/lib/Git/BugsWebPostReceiveHook.php b/lib/Git/BugsWebPostReceiveHook.php index fa4ebb7..f96fe4a 100644 --- a/lib/Git/BugsWebPostReceiveHook.php +++ b/lib/Git/BugsWebPostReceiveHook.php @@ -41,17 +41,15 @@ class BugsWebPostReceiveHook extends ReceiveHook \Git::GIT_EXECUTABLE, $repourl ); -exec($cmd, $output); +exec($cmd, $heads); -/* do we have heads? otherwise it's a new repo! */ -$heads = implode(' ', $output); -$not = count($output) 0 ? sprintf('--not %s', escapeshellarg($heads)) : ''; +$not = count($output) 0 ? ' --not ' . implode(' ', $this-escapeArrayShellArgs($heads)) : ''; $cmd = sprintf( '%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s %s', \Git::GIT_EXECUTABLE, $repourl, -$not, -escapeshellarg($new) +escapeshellarg($new), +$not ); exec($cmd, $output); } elseif ($new != \Git::NULLREV) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] del karma: lib/Git/BugsWebPostReceiveHook.php
Branch: master Deleted commits count: 1 User: Alexander Moskaliov ir...@php.net Sat, 07 Apr 2012 10:52:37 + Changed paths: M lib/Git/BugsWebPostReceiveHook.php Diff: diff --git b/lib/Git/BugsWebPostReceiveHook.php a/lib/Git/BugsWebPostReceiveHook.php index f96fe4a..b608b88 100644 --- b/lib/Git/BugsWebPostReceiveHook.php +++ a/lib/Git/BugsWebPostReceiveHook.php @@ -43,7 +43,7 @@ class BugsWebPostReceiveHook extends ReceiveHook ); exec($cmd, $heads); -$not = count($output) 0 ? ' --not ' . implode(' ', $this-escapeArrayShellArgs($heads)) : ''; +$not = count($heads) 0 ? ' --not ' . implode(' ', $this-escapeArrayShellArgs($heads)) : ''; $cmd = sprintf( '%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s %s', \Git::GIT_EXECUTABLE, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix double bugs: lib/Git/BugsWebPostReceiveHook.php
Commit:bc220ca91ec470baab210cb652c22f10abc689c6 Author:Alexander Moskaliov ir...@php.net Sat, 7 Apr 2012 14:45:22 +0400 Parents: 61cc09b1cbe8e3dcec3cf6b0447d942755c85a7c Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=bc220ca91ec470baab210cb652c22f10abc689c6 Log: fix double bugs Changed paths: M lib/Git/BugsWebPostReceiveHook.php Diff: diff --git a/lib/Git/BugsWebPostReceiveHook.php b/lib/Git/BugsWebPostReceiveHook.php index fa4ebb7..b608b88 100644 --- a/lib/Git/BugsWebPostReceiveHook.php +++ b/lib/Git/BugsWebPostReceiveHook.php @@ -41,17 +41,15 @@ class BugsWebPostReceiveHook extends ReceiveHook \Git::GIT_EXECUTABLE, $repourl ); -exec($cmd, $output); +exec($cmd, $heads); -/* do we have heads? otherwise it's a new repo! */ -$heads = implode(' ', $output); -$not = count($output) 0 ? sprintf('--not %s', escapeshellarg($heads)) : ''; +$not = count($heads) 0 ? ' --not ' . implode(' ', $this-escapeArrayShellArgs($heads)) : ''; $cmd = sprintf( '%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s %s', \Git::GIT_EXECUTABLE, $repourl, -$not, -escapeshellarg($new) +escapeshellarg($new), +$not ); exec($cmd, $output); } elseif ($new != \Git::NULLREV) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix double bugs: lib/Git/PostReceiveHook.php
Commit:e7cb7e7acfaa66261f38a3f8047e09e59b2e0413 Author:Alexander Moskaliov ir...@php.net Wed, 4 Apr 2012 16:37:31 +0400 Parents: a103092576b8d9d7ade835308e8d12ff130a59cf Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=e7cb7e7acfaa66261f38a3f8047e09e59b2e0413 Log: fix double bugs Changed paths: M lib/Git/PostReceiveHook.php Diff: diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 77396d4..e331101 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -486,7 +486,7 @@ class PostReceiveHook extends ReceiveHook $bugs = []; if (preg_match_all('/(?:(pecl|pear|php)\s*)?(?:bug|#)[\s#:]*([0-9]+)/iuX', $log, $matchedBugs, PREG_SET_ORDER)) { foreach($matchedBugs as $bug) { -$bugs[] = $bugUrlPrefixes[$bug[1]] . $bug[2]; +$bugs[$bug[2]] = $bugUrlPrefixes[$bug[1]] . $bug[2]; } } return $bugs; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix user: hooks/commit-bugs.php hooks/post-receive.bugsweb
Commit:61cc09b1cbe8e3dcec3cf6b0447d942755c85a7c Author:Alexander Moskaliov ir...@php.net Wed, 4 Apr 2012 17:17:51 +0400 Parents: e7cb7e7acfaa66261f38a3f8047e09e59b2e0413 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=61cc09b1cbe8e3dcec3cf6b0447d942755c85a7c Log: fix user Changed paths: M hooks/commit-bugs.php M hooks/post-receive.bugsweb Diff: diff --git a/hooks/commit-bugs.php b/hooks/commit-bugs.php index df5b913..0995822 100644 --- a/hooks/commit-bugs.php +++ b/hooks/commit-bugs.php @@ -64,7 +64,7 @@ foreach ($bug_list as $k = $bug) { Log: {$commit_info['log_message']}\n; $postdata = array( -'user' = $commit_info['author'], +'user' = $commit_info['user'], 'id' = $bug['number'], 'ncomment' = $comment, 'MAGIC_COOKIE' = $SVN_MAGIC_COOKIE, diff --git a/hooks/post-receive.bugsweb b/hooks/post-receive.bugsweb index cc91c4a..fc95c13 100755 --- a/hooks/post-receive.bugsweb +++ b/hooks/post-receive.bugsweb @@ -67,6 +67,7 @@ foreach ($rpath as $commit) { $commit_info['log_message'] = $commitMsg; $commit_info['author'] = $committer; $commit_info['author'] = preg_replace(#@php\.net$#, , $committer); +$commit_info['user'] = $user; $viewvc_url_prefix = sprintf( 'http://git.php.net/?p=%s;a=commit;h=', $hook-getRepositoryName() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Add mails about deleted commits and branch: lib/Git/PostReceiveHook.php lib/Git/ReceiveHook.php
Commit:a103092576b8d9d7ade835308e8d12ff130a59cf Author:Alexander Moskaliov ir...@php.net Tue, 3 Apr 2012 16:00:42 +0400 Parents: 410216d61c4f23d552e87741161844685e640b87 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=a103092576b8d9d7ade835308e8d12ff130a59cf Log: Add mails about deleted commits and branch Changed paths: M lib/Git/PostReceiveHook.php M lib/Git/ReceiveHook.php diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index f524fa6..77396d4 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -82,9 +82,17 @@ class PostReceiveHook extends ReceiveHook if ($ref['reftype'] == self::REF_TAG) { // tag mail $this-sendTagMail($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); -} elseif ($ref['reftype'] == self::REF_BRANCH $ref['changetype'] != self::TYPE_DELETED) { -// magic populate the $this-revisions -$this-getBranchRevisions($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); +} elseif ($ref['reftype'] == self::REF_BRANCH) { +if ($ref['changetype'] != self::TYPE_DELETED) { +// magic populate the $this-revisions +$this-getBranchRevisions($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); + +if ($ref['changetype'] == self::TYPE_UPDATED) { +$this-sendDeletedCommitsMail($ref['refname'], $ref['old'], $ref['new']); +} +} else { +$this-sendDeletedBranchMail($ref['refname']); +} } } @@ -98,113 +106,135 @@ class PostReceiveHook extends ReceiveHook } } + /** - * Send mail about branch. - * Subject: [git] [branch] %PROJECT%: %STATUS% branch %BRANCH_NAME% + * Send mail about force deleted commits. + * Subject: del %PROJECT%: %PATHS% * Body: - * Branch %BRANCH_NAME% in %PROJECT% was %STATUS% - * Date: Thu, 08 Mar 2012 12:39:48 +(current mail date) - * - * Link: http://git.php.net/?p=%PROJECT_PATH%;a=log;h=%SHA_NEW%;hp=%SHA_OLD% + * Branch: %BRANCH% + * Deleted commits count: %REV_COUNT% + * User: %USER% Thu, 08 Mar 2012 12:39:48 + * * --part1-- - * Log: - * - * --per commit-- - * Commit: %SHA% - * Author: %USER% Thu, 08 Mar 2012 12:39:48 + - * Committer: %USER% Thu, 08 Mar 2012 12:39:48 + - * Link: http://git.php.net/?p=%PROJECT_PATH%;a=commitdiff;h=%SHA% - * Shortlog: %COMMIT_SUBJECT% - * --/per commit-- - * + * Changed paths: + * %PATHS% * --/part1-- * + * --part2-- + * Diff: + * %DIFF% + * --/part2-- + * * @param string $name branch fullname (refs/heads/example) - * @param int $changeType delete, create or update * @param string $oldrev old revision * @param string $newrev new revision - * @return string mail uniq id */ -private function sendBranchMail($name, $changeType, $oldrev, $newrev) +private function sendDeletedCommitsMail($name, $oldrev, $newrev) { -$logString = ''; -$status = [self::TYPE_UPDATED = 'update', self::TYPE_CREATED = 'create', self::TYPE_DELETED = 'delete']; -$shortname = str_replace('refs/heads/', '', $name); +$deletedRevisionsCount = count($this-getRevisions(escapeshellarg($newrev . '..' . $oldrev))); -// forced push -if ($changeType == self::TYPE_UPDATED) { -$replacedRevisions = $this-getRevisions(escapeshellarg($newrev . '..' . $oldrev)) ?: false; -} else { -$replacedRevisions = false; -} - -if ($changeType != self::TYPE_DELETED) { +if ($deletedRevisionsCount 0) { +$shortName = str_replace('refs/heads/', '', $name); -$revisions = $this-getBranchRevisions($name, $changeType, $oldrev, $newrev); +$paths = $this-getChangedPaths(escapeshellarg($newrev . '..' . $oldrev), true); +$pathsString = ''; +foreach ($paths as $path = $action) +{ +$pathsString .= ' ' . $action . ' ' . $path . \n; +} -if (count($revisions)) { +$isTrivialMerge = count($paths) = 0; + +if (!$isTrivialMerge) { + +$diff = \Git::gitExec('diff-tree --cc -r -R --no-commit-id %s', escapeshellarg($newrev . '..' . $oldrev)); + +$mail = new \Mail(); +$mail-setSubject($this-emailPrefix . 'del ' . $this-getRepositoryShortName() . ': '. implode(' ', array_keys($paths))); +$mail-setTimestamp(strtotime(date('r'))); + +$message = 'Branch: ' . $shortName
[PHP-CVS] com karma: Omitting uninteresting hunks in merge commit diff: lib/Git/PostReceiveHook.php
Commit:410216d61c4f23d552e87741161844685e640b87 Author:Alexander Moskaliov ir...@php.net Sat, 31 Mar 2012 21:41:35 +0400 Parents: fd555bb040c8ea3d3ddf719315194bdf66e30a77 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=410216d61c4f23d552e87741161844685e640b87 Log: Omitting uninteresting hunks in merge commit diff Changed paths: M lib/Git/PostReceiveHook.php Diff: 410216d61c4f23d552e87741161844685e640b87 diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index a7436bd..f524fa6 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -515,7 +515,7 @@ class PostReceiveHook extends ReceiveHook $info = $this-getCommitInfo($revision); -$diff = \Git::gitExec('diff-tree -c -p %s', escapeshellarg($revision)); +$diff = \Git::gitExec('diff-tree --cc -r --no-commit-id %s', escapeshellarg($revision)); $mail = new \Mail(); $mail-setSubject($this-emailPrefix . 'com ' . $this-getRepositoryShortName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix reject for empty paths while trivial merge: hooks/pre-receive
Commit:fd555bb040c8ea3d3ddf719315194bdf66e30a77 Author:Alexander Moskaliov ir...@php.net Fri, 30 Mar 2012 17:18:54 +0400 Parents: c059938d0d11b3c28b242f294c532484a15c826c Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=fd555bb040c8ea3d3ddf719315194bdf66e30a77 Log: fix reject for empty paths while trivial merge Changed paths: M hooks/pre-receive Diff: fd555bb040c8ea3d3ddf719315194bdf66e30a77 diff --git a/hooks/pre-receive b/hooks/pre-receive index 02789e9..b23fb2c 100755 --- a/hooks/pre-receive +++ b/hooks/pre-receive @@ -118,7 +118,7 @@ $pi= new \Git\PushInformation($hook); $req_paths = ($pi-isNewBranch() || $pi-isForced() || $pi-isTag()) ? [''] : $hook-getReceivedPaths(); if (empty($req_paths)) { -deny(We cannot figure out what you comitted!); +$req_paths = ['']; // we can empty paths for trivial merge } $prefix = sprintf('%s/', $repo_name); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: replace git show in getChangedPaths by git diff-tree: lib/Git/ReceiveHook.php
Commit:3082cb40bcf3f11894b70ccd735ecda9f94fc899 Author:Alexander Moskaliov ir...@php.net Wed, 28 Mar 2012 10:25:02 +0400 Parents: fd251cb983a0be8628d4e435aed2775cf37c5f71 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=3082cb40bcf3f11894b70ccd735ecda9f94fc899 Log: replace git show in getChangedPaths by git diff-tree Changed paths: M lib/Git/ReceiveHook.php Diff: 3082cb40bcf3f11894b70ccd735ecda9f94fc899 diff --git a/lib/Git/ReceiveHook.php b/lib/Git/ReceiveHook.php index 1bf4bfa..0100d6e 100644 --- a/lib/Git/ReceiveHook.php +++ b/lib/Git/ReceiveHook.php @@ -82,7 +82,7 @@ abstract class ReceiveHook */ protected function getChangedPaths($revRange) { -$raw = \Git::gitExec('show --name-status --pretty=format: %s', $revRange); +$raw = \Git::gitExec('diff-tree -r --no-commit-id -c --name-status --pretty=format: %s', $revRange); $paths = []; $lines = explode(\n, $raw); foreach($lines as $line) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: replace git show by git diff in getChangedPaths: lib/Git/ReceiveHook.php
Commit:c69f9e879c21addbfa45cacd2c9dfbd10a345786 Author:Alexander Moskaliov ir...@php.net Tue, 27 Mar 2012 17:18:22 +0400 Parents: fd251cb983a0be8628d4e435aed2775cf37c5f71 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=c69f9e879c21addbfa45cacd2c9dfbd10a345786 Log: replace git show by git diff in getChangedPaths Changed paths: M lib/Git/ReceiveHook.php Diff: c69f9e879c21addbfa45cacd2c9dfbd10a345786 diff --git a/lib/Git/ReceiveHook.php b/lib/Git/ReceiveHook.php index 1bf4bfa..9ff67d1 100644 --- a/lib/Git/ReceiveHook.php +++ b/lib/Git/ReceiveHook.php @@ -82,7 +82,7 @@ abstract class ReceiveHook */ protected function getChangedPaths($revRange) { -$raw = \Git::gitExec('show --name-status --pretty=format: %s', $revRange); +$raw = \Git::gitExec('diff --name-status --pretty=format: %s', $revRange); $paths = []; $lines = explode(\n, $raw); foreach($lines as $line) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/pdo_mysql/mysql_statement.c
Hello! Mail script show combined diff for merge commits: http://git.php.net/?p=php-src.git;a=commitdiff;h=7f05a39fce42029c126d6dc315ffdad43d27c8e9;hp=-c It's diff between 3 revisions. (2 parents and 1 merge commit). With regards, Alexander Moskaliov ir...@irker.net 2012/3/25 Pierrick Charron pierr...@php.net: I looked at the git log/diff and I think there is a problem with the mailing system. It did not send the diff from the good parent for the merge. Pierrick On 24 March 2012 18:07, Pierrick Charron pierr...@php.net wrote: Hmmm I think I have the same issue as Hannes. All those changes are not the one I did on the 5.3 branch. Any clue on how to deal with that ? Thanks Pierrick On 24 March 2012 17:59, Pierrick Charron pierr...@php.net wrote: Commit: 7f05a39fce42029c126d6dc315ffdad43d27c8e9 Author: Pierrick Charron pierr...@php.net Sat, 24 Mar 2012 17:59:46 -0400 Parents: 10809686f0dbcbbf0eb06c968d65e0febe1dc034 da2da13f935b2775635cd21b47a78fbf025a462d Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7f05a39fce42029c126d6dc315ffdad43d27c8e9 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/pdo_mysql/mysql_statement.c Diff: 7f05a39fce42029c126d6dc315ffdad43d27c8e9 diff --combined ext/pdo_mysql/mysql_statement.c index 20e67e4,115e74c..0c2689f --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@@ -59,10 -59,12 +59,10 @@@ static int pdo_mysql_stmt_dtor(pdo_stmt pefree(S-einfo.errmsg, stmt-dbh-is_persistent); S-einfo.errmsg = NULL; } -#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND if (S-stmt) { pdo_mysql_stmt_close(S-stmt); S-stmt = NULL; } -#endif /* HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND */ #ifndef PDO_USE_MYSQLND if (S-params) { @@@ -75,6 -77,9 +75,6 @@@ efree(S-in_length); } -#endif /* PDO_USE_MYSQLND */ - -#ifdef HAVE_MYSQL_STMT_PREPARE if (S-bound_result) { int i; @@@ -86,9 -91,10 +86,9 @@@ efree(S-out_null); efree(S-out_length); } -#endif /* HAVE_MYSQL_STMT_PREPARE */ +#endif -#if HAVE_MYSQL_NEXT_RESULT || PDO_USE_MYSQLND if (S-H-server) { while (mysql_more_results(S-H-server)) { MYSQL_RES *res; @@@ -101,8 -107,8 +101,8 @@@ mysql_free_result(res); } } - } -#endif /* HAVE_MYSQL_NEXT_RESULT || PDO_USE_MYSQLND */ + } + #if PDO_USE_MYSQLND if (!S-stmt S-current_data) { mnd_free(S-current_data); @@@ -158,7 -164,7 +158,7 @@@ static int pdo_mysql_fill_stmt_from_res } /* }}} */ -#ifdef HAVE_MYSQL_STMT_PREPARE +#ifndef PDO_USE_MYSQLND static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ { pdo_mysql_stmt *S = stmt-driver_data; @@@ -316,13 -322,14 +316,12 @@@ static int pdo_mysql_stmt_execute(pdo_s { pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt-driver_data; pdo_mysql_db_handle *H = S-H; PDO_DBG_ENTER(pdo_mysql_stmt_execute); PDO_DBG_INF_FMT(stmt=%p, S-stmt); if (S-stmt) { PDO_DBG_RETURN(pdo_mysql_stmt_execute_prepared(stmt)); } -#endif /* ensure that we free any previous unfetched results */ if (S-result) { @@@ -341,6 -348,7 +340,6 @@@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ { -#if HAVE_MYSQL_NEXT_RESULT || PDO_USE_MYSQLND pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt-driver_data; pdo_mysql_db_handle *H = S-H; long row_count; @@@ -402,7 -410,7 +401,7 @@@ #endif /* ensure that we free any previous unfetched results */ -#if HAVE_MYSQL_STMT_PREPARE +#ifndef PDO_USE_MYSQLND if (S-stmt) { stmt-column_count = (int)mysql_num_fields(S-result); mysql_stmt_free_result(S-stmt); @@@ -424,6 -432,10 +423,6 @@@ } else { PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC)); } -#else - strcpy(stmt-error_code, HYC00); - PDO_DBG_RETURN(0); -#endif /* HAVE_MYSQL_STMT_PREPARE */ } /* }}} */ @@@ -445,6 -457,7 +444,6 @@@ static int pdo_mysql_stmt_param_hook(pd #ifndef PDO_USE_MYSQLND PDO_MYSQL_PARAM_BIND *b; #endif -#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt-driver_data; PDO_DBG_ENTER(pdo_mysql_stmt_param_hook); @@@ -576,7 -589,7 +575,7 @@@ break; } } -#endif /* HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND */ + PDO_DBG_RETURN(1); } /* }}} */ @@@ -597,6 -610,7 +596,6 @@@ static int pdo_mysql_stmt_fetch(pdo_stm PDO_DBG_RETURN(1); } #else
[PHP-CVS] com karma: add safety value for reftype: lib/Git/ReceiveHook.php
Commit:31ccabcd4f9c19844192f3b7fa72c2bbaf2ed6b7 Author:Alexander Moskaliov ir...@php.net Sat, 24 Mar 2012 13:56:57 +0400 Parents: deed69a3a56adc67972a0f8795eeb539b7d8d6cb Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=31ccabcd4f9c19844192f3b7fa72c2bbaf2ed6b7 Log: add safety value for reftype Changed paths: M lib/Git/ReceiveHook.php Diff: 31ccabcd4f9c19844192f3b7fa72c2bbaf2ed6b7 diff --git a/lib/Git/ReceiveHook.php b/lib/Git/ReceiveHook.php index e4e879a..1bf4bfa 100644 --- a/lib/Git/ReceiveHook.php +++ b/lib/Git/ReceiveHook.php @@ -150,7 +150,7 @@ abstract class ReceiveHook $ref['reftype'] = self::REF_TAG; } else { // not support by this script -$ref['reftype'] = null; +$ref['reftype'] = -1; } if ($ref['old'] == \GIT::NULLREV) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix one line ref bug: hooks/post-receive
Commit:8e826dd710ddcbc2464f5e978f1f2a4105a66d7d Author:Alexander Moskaliov ir...@php.net Sat, 24 Mar 2012 15:03:27 +0400 Parents: 31ccabcd4f9c19844192f3b7fa72c2bbaf2ed6b7 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=8e826dd710ddcbc2464f5e978f1f2a4105a66d7d Log: fix one line ref bug Changed paths: M hooks/post-receive Diff: 8e826dd710ddcbc2464f5e978f1f2a4105a66d7d diff --git a/hooks/post-receive b/hooks/post-receive index 74fce6b..2045e42 100755 --- a/hooks/post-receive +++ b/hooks/post-receive @@ -1,5 +1,5 @@ #!/bin/sh in=$(cat) -[ -f 'hooks/post-receive.mail' ] (echo $in | hooks/post-receive.mail ) -[ -f 'hooks/post-receive.bugsweb' ] (echo $in | hooks/post-receive.bugsweb ) +[ -f 'hooks/post-receive.mail' ] (echo $in | hooks/post-receive.mail ) +[ -f 'hooks/post-receive.bugsweb' ] (echo $in | hooks/post-receive.bugsweb ) [ -f 'hooks/post-receive.mirror' ] hooks/post-receive.mirror -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fix NEWS: NEWS
Hi! Some names (like your) already stored in DB in esacaped variant. But some other names not escaped in this DB file, but still escaped after my mail script. May be by mailing list. With regards, Alexander Moskaliov ir...@irker.net 2012/3/24 Johannes Schlüter johan...@php.net: On Sat, 2012-03-24 at 07:59 +0100, Michael Wallner wrote: Looks like the commit/mail script still does some superfluous html entitiy encoding: No it's not the mail script ;-) master.php.net has filter.default=full_special_chars so when storing my name it is automatically escaped and the escaped form is stored in the DB. The mail script simply takes it from there. I see three ways to fix it: * Use special_chars, not full_special_chars a filter, should be safe enough * Use html_entity_decode() in the mail script, this feels like a hack * Store unescaped data in the DB and escape (everywhere) where it is used (I don't think we can successfully do that) In my opinion the first option is the best. Could anybody with the needed powers look into that? Thanks, johannes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Remove commit data cache.: lib/Git/PostReceiveHook.php
Commit:00fd9038da096f1e283f85bab24e789bd84523af Author:Alexander Moskaliov ir...@php.net Fri, 23 Mar 2012 09:53:30 +0400 Parents: b6b01b9106a29aefe97dcab12c39501ff4ecdb69 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=00fd9038da096f1e283f85bab24e789bd84523af Log: Remove commit data cache. This cache was added because same commits data was used in branch,tag and commit mails. Now we remove branch mails, so we not need cache more. Changed paths: M lib/Git/PostReceiveHook.php Diff: 00fd9038da096f1e283f85bab24e789bd84523af diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 11d3996..7a84f5f 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -13,7 +13,6 @@ class PostReceiveHook extends ReceiveHook private $alreadyExistsBranches = []; private $updatedBranches = []; private $revisions = []; -private $commitsData = []; private $allBranches = []; @@ -428,22 +427,20 @@ class PostReceiveHook extends ReceiveHook */ private function getCommitInfo($revision) { -if (!isset($this-commitsData[$revision])) { -$raw = \Git::gitExec('rev-list -n 1 --format=%%P%%n%%an%%n%%ae%%n%%aD%%n%%cn%%n%%ce%%n%%cD%%n%%s%%n%%B %s', escapeshellarg($revision)); -$raw = explode(\n, trim($raw), 10); //10 elements separated by \n, last element - log message, first(skipped) element - commit sha -$this-commitsData[$revision] = [ -'parents' = $raw[1], // %P -'author'= $raw[2], // %an -'author_email' = $raw[3], // %ae -'author_date' = $raw[4], // %aD -'committer' = $raw[5], // %cn -'committer_email' = $raw[6], // %ce -'committer_date'= $raw[7], // %cD -'subject' = $raw[8], // %s -'log' = $raw[9] // %B -]; -} -return $this-commitsData[$revision]; +$raw = \Git::gitExec('rev-list -n 1 --format=%%P%%n%%an%%n%%ae%%n%%aD%%n%%cn%%n%%ce%%n%%cD%%n%%s%%n%%B %s', escapeshellarg($revision)); +$raw = explode(\n, trim($raw), 10); //10 elements separated by \n, last element - log message, first(skipped) element - commit sha +$data = [ +'parents' = $raw[1], // %P +'author'= $raw[2], // %an +'author_email' = $raw[3], // %ae +'author_date' = $raw[4], // %aD +'committer' = $raw[5], // %cn +'committer_email' = $raw[6], // %ce +'committer_date'= $raw[7], // %cD +'subject' = $raw[8], // %s +'log' = $raw[9] // %B +]; +return $data; } /** -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Small refactoring: lib/Git/PostReceiveHook.php
Commit:c32cd6bf135db5eda1f074f62130ec24957a98a7 Author:Alexander Moskaliov ir...@php.net Fri, 23 Mar 2012 10:16:44 +0400 Parents: 00fd9038da096f1e283f85bab24e789bd84523af Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=c32cd6bf135db5eda1f074f62130ec24957a98a7 Log: Small refactoring Changed paths: M lib/Git/PostReceiveHook.php c32cd6bf135db5eda1f074f62130ec24957a98a7 diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 7a84f5f..3b877b1 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -16,8 +16,6 @@ class PostReceiveHook extends ReceiveHook private $allBranches = []; -private $branchesMailIds = []; - /** * @param string $basePath base path for all repositories * @param string $pushAuthor user who make push @@ -79,19 +77,17 @@ class PostReceiveHook extends ReceiveHook } $this-alreadyExistsBranches = array_diff($this-allBranches, $newBranches); -//send mails per ref push + foreach ($this-refs as $ref) { if ($ref['reftype'] == self::REF_TAG) { +// tag mail $this-sendTagMail($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); -} -} - -foreach($this-refs as $ref) { -// magic populate the $this-revisions -if ($ref['reftype'] == self::REF_BRANCH $ref['changetype'] != self::TYPE_DELETED) { +} elseif ($ref['reftype'] == self::REF_BRANCH $ref['changetype'] != self::TYPE_DELETED) { +// magic populate the $this-revisions $this-getBranchRevisions($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); } } + $this-log('Found revisions: '. implode(' ', array_keys($this-revisions))); //send mails per commit foreach ($this-revisions as $revision = $branches) { @@ -473,6 +469,7 @@ class PostReceiveHook extends ReceiveHook * Author: %USER% Thu, 08 Mar 2012 12:39:48 + * Committer: %USER% Thu, 08 Mar 2012 12:39:48 + * Parents: %SHA_PARENTS% + * Branches: %BRANCHES% * * Link: http://git.php.net/?p=%PROJECT_PATH%;a=commitdiff;h=%SHA% * @@ -497,80 +494,85 @@ class PostReceiveHook extends ReceiveHook private function sendCommitMail($revision, $branches) { -$bnames = array_map(function($x) { -return str_replace('refs/heads/', '', $x); -}, $branches); - -$info = $this-getCommitInfo($revision); $paths = $this-getChangedPaths(escapeshellarg($revision)); $pathsString = ''; foreach ($paths as $path = $action) { $pathsString .= ' ' . $action . ' ' . $path . \n; } -$diff = \Git::gitExec('diff-tree -c -p %s', escapeshellarg($revision)); -$mail = new \Mail(); -$mail-setSubject($this-emailPrefix . 'com ' . $this-getRepositoryShortName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); -$mail-setTimestamp(strtotime($info['author_date'])); +$isTrivialMerge = empty($pathsString); -$message = ''; +if (!$isTrivialMerge) { -$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; +$bnames = array_map( +function($x) { +return str_replace('refs/heads/', '', $x); +}, +$branches +); -$message .= Branches: . implode(' ', $bnames) . \n; -$message .= \n . Link: http://git.php.net/?p=; . $this-getRepositoryName() . ;a=commitdiff;h= . $revision . \n; +$info = $this-getCommitInfo($revision); -$message .= \nLog:\n . $info['log'] . \n; +$diff = \Git::gitExec('diff-tree -c -p %s', escapeshellarg($revision)); -if ($bugs = $this-getBugs($info['log'])) { -$message .= \nBugs:\n . implode(\n, $bugs) . \n; -} +$mail = new \Mail(); +$mail-setSubject($this-emailPrefix . 'com ' . $this-getRepositoryShortName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); +$mail-setTimestamp(strtotime($info['author_date'])); -$isTrivialMerge = empty($pathsString); +$message = ''; -if (!$isTrivialMerge strlen($pathsString) 8192
[PHP-CVS] com karma: fix undefined info bug: lib/Git/PostReceiveHook.php
Commit:51d545a5ce6759e7b9afcaa410ef92a8bbe4a01a Author:Alexander Moskaliov ir...@php.net Fri, 23 Mar 2012 10:44:18 +0400 Parents: c32cd6bf135db5eda1f074f62130ec24957a98a7 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=51d545a5ce6759e7b9afcaa410ef92a8bbe4a01a Log: fix undefined info bug Changed paths: M lib/Git/PostReceiveHook.php Diff: 51d545a5ce6759e7b9afcaa410ef92a8bbe4a01a diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 3b877b1..b7f632d 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -260,13 +260,13 @@ class PostReceiveHook extends ReceiveHook $shortname = str_replace('refs/tags/', '', $name); $mail = new \Mail(); $mail-setSubject($this-emailPrefix . 'tag ' . $this-getRepositoryShortName() . ': ' . $status[$changeType] . ' tag ' . $shortname); -$mail-setTimestamp(strtotime($info['tagger_date'])); $message = 'Tag ' . $shortname . ' in ' . $this-getRepositoryName() . ' was ' . $status[$changeType] . 'd' . (($changeType != self::TYPE_CREATED) ? ' from ' . $oldrev : '' ) . \n; if ($changeType != self::TYPE_DELETED) { $info = $this-getTagInfo($name); +$mail-setTimestamp(strtotime($info['tagger_date'])); $targetInfo = $this-getCommitInfo($info['target']); $targetPaths = $this-getChangedPaths(escapeshellarg($info['target'])); $pathsString = ''; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: add log for tag: lib/Git/PostReceiveHook.php
Commit:74122fc5eefce2404a13e7fc5a37067bb6106881 Author:Alexander Moskaliov ir...@php.net Fri, 23 Mar 2012 10:51:23 +0400 Parents: 51d545a5ce6759e7b9afcaa410ef92a8bbe4a01a Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=74122fc5eefce2404a13e7fc5a37067bb6106881 Log: add log for tag Changed paths: M lib/Git/PostReceiveHook.php Diff: 74122fc5eefce2404a13e7fc5a37067bb6106881 diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index b7f632d..eecc9cf 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -315,7 +315,8 @@ class PostReceiveHook extends ReceiveHook $mail-setFrom($this-pushAuthor . '@php.net', $this-pushAuthorName); $mail-addTo($this-mailingList); -$mail-send(); +$result = $mail-send(); +$this-log('tag ' . $name . ($result ? ' was send' : ' error while sending')); } /** -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix fatal error while deleting tag: lib/Git/BugsWebPostReceiveHook.php
Commit:0f69df22dc02dd48ede2d73b14881b7cd12ff797 Author:Alexander Moskaliov ir...@php.net Fri, 23 Mar 2012 11:07:15 +0400 Parents: 74122fc5eefce2404a13e7fc5a37067bb6106881 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=0f69df22dc02dd48ede2d73b14881b7cd12ff797 Log: fix fatal error while deleting tag Changed paths: M lib/Git/BugsWebPostReceiveHook.php Diff: 0f69df22dc02dd48ede2d73b14881b7cd12ff797 diff --git a/lib/Git/BugsWebPostReceiveHook.php b/lib/Git/BugsWebPostReceiveHook.php index ee54826..fb0feac 100644 --- a/lib/Git/BugsWebPostReceiveHook.php +++ b/lib/Git/BugsWebPostReceiveHook.php @@ -34,7 +34,7 @@ class BugsWebPostReceiveHook extends ReceiveHook $repourl = \Git::getRepositoryPath(); $output = []; -if ($old == '') { +if ($old == \Git::NULLREV) { $cmd = sprintf( %s --git-dir=%s for-each-ref --format='%%(refname)' 'refs/heads/*', \Git::GIT_EXECUTABLE, @@ -53,7 +53,7 @@ class BugsWebPostReceiveHook extends ReceiveHook escapeshellarg($new) ); exec($cmd, $output); -} else { +} elseif ($new != \Git::NULLREV) { $cmd = sprintf( '%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s..%s', \Git::GIT_EXECUTABLE, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: check only branch changes in bugsweb: lib/Git/BugsWebPostReceiveHook.php
Commit:b2c216852c420a55da06830e3d80759961875815 Author:Alexander Moskaliov ir...@php.net Fri, 23 Mar 2012 11:16:47 +0400 Parents: aa1ceee7c98d64e501f93ccc789314d795a6afee Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=b2c216852c420a55da06830e3d80759961875815 Log: check only branch changes in bugsweb Changed paths: M lib/Git/BugsWebPostReceiveHook.php Diff: b2c216852c420a55da06830e3d80759961875815 diff --git a/lib/Git/BugsWebPostReceiveHook.php b/lib/Git/BugsWebPostReceiveHook.php index fb0feac..fa4ebb7 100644 --- a/lib/Git/BugsWebPostReceiveHook.php +++ b/lib/Git/BugsWebPostReceiveHook.php @@ -8,11 +8,12 @@ class BugsWebPostReceiveHook extends ReceiveHook { $this-hookInput(); -$paths = array_map( -function ($input) { -return $this-getReceivedMessagesForRange($input['old'], $input['new']); -}, -$this-refs); +$paths = []; +foreach ($this-refs as $ref) { +if ($ref['reftype'] == self::REF_BRANCH) { +$paths[] = $this-getReceivedMessagesForRange($ref['old'], $ref['new']); +} +} /* remove empty lines, and flattern the array */ $flattend = array_reduce($paths, 'array_merge', []); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix undefined tagger_date for not annotated tags: lib/Git/PostReceiveHook.php
Commit:aa1ceee7c98d64e501f93ccc789314d795a6afee Author:Alexander Moskaliov ir...@php.net Fri, 23 Mar 2012 11:11:10 +0400 Parents: 0f69df22dc02dd48ede2d73b14881b7cd12ff797 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=aa1ceee7c98d64e501f93ccc789314d795a6afee Log: fix undefined tagger_date for not annotated tags Changed paths: M lib/Git/PostReceiveHook.php Diff: aa1ceee7c98d64e501f93ccc789314d795a6afee diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index eecc9cf..2a54abc 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -266,7 +266,6 @@ class PostReceiveHook extends ReceiveHook if ($changeType != self::TYPE_DELETED) { $info = $this-getTagInfo($name); -$mail-setTimestamp(strtotime($info['tagger_date'])); $targetInfo = $this-getCommitInfo($info['target']); $targetPaths = $this-getChangedPaths(escapeshellarg($info['target'])); $pathsString = ''; @@ -279,6 +278,7 @@ class PostReceiveHook extends ReceiveHook $message .= 'Tag: ' . $info['revision'] . \n; $message .= 'Tagger: ' . $info['tagger'] . $info['tagger_email'] . ' ' . $info['tagger_date'] . \n; $message .= Log:\n . $info['log'] . \n; +$mail-setTimestamp(strtotime($info['tagger_date'])); } $message .= \n; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Fix double and in tagger email: lib/Git/PostReceiveHook.php
Commit:017216d047d98445579ff6a4fe55dbcb1c7bc85c Author:Alexander Moskaliov ir...@php.net Thu, 22 Mar 2012 12:29:30 +0400 Parents: 4eb17646d5c809be94d25e04910db474e4ff1848 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=017216d047d98445579ff6a4fe55dbcb1c7bc85c Log: Fix double and in tagger email getTagInfo return mail with and , getCommitInfo without Changed paths: M lib/Git/PostReceiveHook.php Diff: 017216d047d98445579ff6a4fe55dbcb1c7bc85c diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index f1594f6..868fc6c 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -281,7 +281,7 @@ class PostReceiveHook extends ReceiveHook if ($info['annotated']) { $message .= 'Tag: ' . $info['revision'] . \n; -$message .= 'Tagger: ' . $info['tagger'] . ' ' . $info['tagger_email'] . ' ' . $info['tagger_date'] . \n; +$message .= 'Tagger: ' . $info['tagger'] . $info['tagger_email'] . ' ' . $info['tagger_date'] . \n; $message .= Log:\n . $info['log'] . \n; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Check for empty outputs, not for return values: lib/Git/PostReceiveHook.php
Commit:4eb17646d5c809be94d25e04910db474e4ff1848 Author:David Soria Parra d...@php.net Thu, 22 Mar 2012 07:55:38 +0100 Committer: Alexander Moskaliov ir...@php.net Thu, 22 Mar 2012 12:27:17 +0400 Parents: 42b7508bdc7867645728fb9e765aecadae333609 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=4eb17646d5c809be94d25e04910db474e4ff1848 Log: Check for empty outputs, not for return values gitExec doesnt return the return value but the output. Therefore check if the output in isRevInBranches is empty. This indicates that it is not. Changed paths: M lib/Git/PostReceiveHook.php Diff: 4eb17646d5c809be94d25e04910db474e4ff1848 diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index b7efb42..f1594f6 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -589,7 +589,8 @@ class PostReceiveHook extends ReceiveHook * @return bool */ private function isRevExistsInBranches($revision, array $branches) { -return !(bool) \Git::gitExec('rev-list --max-count=1 %s --not %s', escapeshellarg($revision), implode(' ', $this-escapeArrayShellArgs($branches))); +$output = \Git::gitExec('rev-list --max-count=1 %s --not %s', escapeshellarg($revision), implode(' ', $this-escapeArrayShellArgs($branches))); +return !empty($output); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: add repository name to log: lib/Git/ReceiveHook.php
Commit:27a6e56893c4bbb46b11d8270cef1874d1e9b0ac Author:Alexander Moskaliov ir...@php.net Thu, 22 Mar 2012 16:36:36 +0400 Parents: 34cd04cc94a253a3ea31eea0cfa376b1ab205a81 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=27a6e56893c4bbb46b11d8270cef1874d1e9b0ac Log: add repository name to log Changed paths: M lib/Git/ReceiveHook.php Diff: 27a6e56893c4bbb46b11d8270cef1874d1e9b0ac diff --git a/lib/Git/ReceiveHook.php b/lib/Git/ReceiveHook.php index 5f30d9a..0c0bcf1 100644 --- a/lib/Git/ReceiveHook.php +++ b/lib/Git/ReceiveHook.php @@ -125,7 +125,7 @@ abstract class ReceiveHook */ public function hookInput() { -$this-log('New hook call '. date('r')); +$this-log('New hook call ' . $this-getRepositoryName() . ' ' . date('r')); $parsed_input = []; while (!feof(STDIN)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Remove var_dump: lib/Git/PostReceiveHook.php
Commit:5a963dbc6c3ef0a08d18ec51bcc795645dc4c8a0 Author:Alexander Moskaliov ir...@php.net Thu, 22 Mar 2012 16:46:03 +0400 Parents: 27a6e56893c4bbb46b11d8270cef1874d1e9b0ac Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=5a963dbc6c3ef0a08d18ec51bcc795645dc4c8a0 Log: Remove var_dump Changed paths: M lib/Git/PostReceiveHook.php Diff: 5a963dbc6c3ef0a08d18ec51bcc795645dc4c8a0 diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 42255b0..11d3996 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -96,7 +96,6 @@ class PostReceiveHook extends ReceiveHook $this-log('Found revisions: '. implode(' ', array_keys($this-revisions))); //send mails per commit foreach ($this-revisions as $revision = $branches) { -var_dump($branches); // check if it commit was already in other branches if (!$this-isRevExistsInBranches($revision, array_diff($this-allBranches, $branches))) { $this-sendCommitMail($revision, $branches); @@ -573,7 +572,7 @@ class PostReceiveHook extends ReceiveHook } } -var_dump($isTrivialMerge); + if (!$isTrivialMerge) { $mail-setMessage($message); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: fix timezone: hooks/post-receive.bugsweb
Commit:d518a6a76e347636432deb6f415f411dbcd780f0 Author:Alexander Moskaliov ir...@php.net Thu, 22 Mar 2012 17:57:26 +0400 Parents: 5a963dbc6c3ef0a08d18ec51bcc795645dc4c8a0 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=d518a6a76e347636432deb6f415f411dbcd780f0 Log: fix timezone Changed paths: M hooks/post-receive.bugsweb Diff: d518a6a76e347636432deb6f415f411dbcd780f0 diff --git a/hooks/post-receive.bugsweb b/hooks/post-receive.bugsweb index 030997c..cc91c4a 100755 --- a/hooks/post-receive.bugsweb +++ b/hooks/post-receive.bugsweb @@ -11,6 +11,7 @@ set_include_path( getenv('KARMA_LIB_PATH') ?: LIB_PATH . PATH_SEPARATOR . get_include_path()); +date_default_timezone_set('UTC'); include 'Git.php'; include 'Git/PushInformation.php'; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: possibly fix for Allowed memory size exhausted error: lib/Git/ReceiveHook.php
Commit:b6b01b9106a29aefe97dcab12c39501ff4ecdb69 Author:Alexander Moskaliov ir...@php.net Thu, 22 Mar 2012 23:11:40 +0400 Parents: d518a6a76e347636432deb6f415f411dbcd780f0 Branches: master Link: http://git.php.net/?p=karma.git;a=commitdiff;h=b6b01b9106a29aefe97dcab12c39501ff4ecdb69 Log: possibly fix for Allowed memory size exhausted error Changed paths: M lib/Git/ReceiveHook.php Diff: b6b01b9106a29aefe97dcab12c39501ff4ecdb69 diff --git a/lib/Git/ReceiveHook.php b/lib/Git/ReceiveHook.php index 0c0bcf1..e4e879a 100644 --- a/lib/Git/ReceiveHook.php +++ b/lib/Git/ReceiveHook.php @@ -84,11 +84,13 @@ abstract class ReceiveHook { $raw = \Git::gitExec('show --name-status --pretty=format: %s', $revRange); $paths = []; -if (preg_match_all('/([ACDMRTUXB*]+)\s+([^\n\s]+)/', $raw , $matches, PREG_SET_ORDER)) { -foreach($matches as $item) { -$paths[$item[2]] = $item[1]; +$lines = explode(\n, $raw); +foreach($lines as $line) { +if (preg_match('/([ACDMRTUXB*]+)\s+([^\n\s]+)/', $line , $matches)) { +$paths[$matches[2]] = $matches[1]; } } + return $paths; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] branch karma.git: update branch master
Branch master in karma.git was updated Date: Tue, 20 Mar 2012 06:50:41 + Link: http://git.php.net/?p=karma.git;a=log;h=42d233ae4752adbce2709553cef0cd456b92a2e0;hp=c3c822e0f983c7514f8043ec11ceeef9c80100c0 Log: Commit: 42d233ae4752adbce2709553cef0cd456b92a2e0 Author: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 10:34:35 +0400 Committer: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 10:35:41 +0400 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=42d233ae4752adbce2709553cef0cd456b92a2e0 Shortlog: Merge branch 'PHP_POST_RECEIVE' Commit: 4a6cbdd7b551664f76c536fd67c009ba25c98d2d Author: Alexander Moskaliov(ir...@php.net) Sun, 18 Mar 2012 19:43:31 +0400 Committer: Alexander Moskaliov(ir...@php.net) Sun, 18 Mar 2012 19:43:31 +0400 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=4a6cbdd7b551664f76c536fd67c009ba25c98d2d Shortlog: add in-reply-to test support and fix phpdoc -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] branch karma.git: delete branch PHP_POST_RECEIVE
Branch PHP_POST_RECEIVE in karma.git was deleted Date: Tue, 20 Mar 2012 06:50:40 + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit karma.git: lib/Git/PostReceiveHook.php lib/Git/ReceiveHook.php
Commit: 42d233ae4752adbce2709553cef0cd456b92a2e0 Author: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 10:34:35 +0400 Committer: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 10:35:41 +0400 Parents: c3c822e0f983c7514f8043ec11ceeef9c80100c0 4a6cbdd7b551664f76c536fd67c009ba25c98d2d Link: http://git.php.net/?p=karma.git;a=commitdiff;h=42d233ae4752adbce2709553cef0cd456b92a2e0 Log: Merge branch 'PHP_POST_RECEIVE' Changed paths: MM lib/Git/PostReceiveHook.php MM lib/Git/ReceiveHook.php 42d233ae4752adbce2709553cef0cd456b92a2e0 diff --combined lib/Git/PostReceiveHook.php index 633ff77,743b6ac..bd3be9b --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@@ -17,12 -17,14 +17,14 @@@ class PostReceiveHook extends ReceiveHo private $allBranches = []; + private $branchesMailIds = []; + /** - * @param $basePath string base path for all repositories - * @param $pushAuthor string user who make push - * @param $usersFile string path to file with users data - * @param $mailingList string mail recipient - * @param $emailPrefix string prefix for mail subject + * @param string $basePath base path for all repositories + * @param string $pushAuthor user who make push + * @param string $usersFile path to file with users data + * @param string $mailingList mail recipient + * @param string $emailPrefix prefix for mail subject */ public function __construct($basePath, $pushAuthor, $usersFile, $mailingList, $emailPrefix) { @@@ -37,73 -39,9 +39,73 @@@ $this-allBranches = $this-getAllBranches(); } + +public function getReceivedMessages() +{ +$this-hookInput(); + +$paths = array_map( +function ($input) { +return $this-getReceivedMessagesForRange($input['old'], $input['new']); +}, +$this-refs); + +/* remove empty lines, and flattern the array */ +$flattend = array_reduce($paths, 'array_merge', []); +$paths= array_filter($flattend); + +return array_unique($paths); +} + +/** + * Returns an array of commit messages between revision $old and $new. + * + * @param string $old The old revison number. + * @parma string $new The new revison umber. + * + * @return array + */ +private function getReceivedMessagesForRange($old, $new) +{ +$repourl = \Git::getRepositoryPath(); +$output = []; + +if ($old == '') { +$cmd = sprintf( +%s --git-dir=%s for-each-ref --format='%%(refname)' 'refs/heads/*', +self::GIT_EXECUTABLE, +$repourl +); +exec($cmd, $output); + +/* do we have heads? otherwise it's a new repo! */ +$heads = implode(' ', $output); +$not = count($output) 0 ? sprintf('--not %s', escapeshellarg($heads)) : ''; +$cmd = sprintf( +'%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s %s', +\Git::GIT_EXECUTABLE, +$repourl, +$not, +escapeshellarg($new) +); +exec($cmd, $output); +} else { +$cmd = sprintf( +'%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s..%s', +\Git::GIT_EXECUTABLE, +$repourl, +escapeshellarg($old), +escapeshellarg($new) +); +exec($cmd, $output); +} + +return $output; +} + /** * Find user name by nickname in users data file - * @param $user user nickname + * @param string $user user nickname * @return string user name */ public function getUserName($user) @@@ -147,7 -85,7 +149,7 @@@ if ($ref['reftype'] == self::REF_TAG) { $this-sendTagMail($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); } elseif ($ref['reftype'] == self::REF_BRANCH){ - $this-sendBranchMail($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); + $this-branchesMailIds[$ref['refname']] = $this-sendBranchMail($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); } } @@@ -155,12 -93,11 +157,11 @@@ foreach ($this-revisions as $revision = $branches) { // check if it commit was already in other branches if (!$this-isRevExistsInBranches($revision, array_diff($this-allBranches, $branches))) { - $this-sendCommitMail($revision); + $this-sendCommitMail($revision, $branches); } } } - /** * Send mail about branch. * Subject: [git] [branch
[PHP-CVS] [git] commit karma.git: lib/Git/PostReceiveHook.php lib/Git/ReceiveHook.php lib/Mail.php
Commit: 4a6cbdd7b551664f76c536fd67c009ba25c98d2d Author: Alexander Moskaliov(ir...@php.net) Sun, 18 Mar 2012 19:43:31 +0400 Committer: Alexander Moskaliov(ir...@php.net) Sun, 18 Mar 2012 19:43:31 +0400 Parents: 7c4de5d5a9e10eb0322d87e69f07e32ad843de60 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=4a6cbdd7b551664f76c536fd67c009ba25c98d2d Log: add in-reply-to test support and fix phpdoc Changed paths: M lib/Git/PostReceiveHook.php M lib/Git/ReceiveHook.php M lib/Mail.php 4a6cbdd7b551664f76c536fd67c009ba25c98d2d diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 5955bc2..743b6ac 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -17,12 +17,14 @@ class PostReceiveHook extends ReceiveHook private $allBranches = []; +private $branchesMailIds = []; + /** - * @param $basePath string base path for all repositories - * @param $pushAuthor string user who make push - * @param $usersFile string path to file with users data - * @param $mailingList string mail recipient - * @param $emailPrefix string prefix for mail subject + * @param string $basePath base path for all repositories + * @param string $pushAuthor user who make push + * @param string $usersFile path to file with users data + * @param string $mailingList mail recipient + * @param string $emailPrefix prefix for mail subject */ public function __construct($basePath, $pushAuthor, $usersFile, $mailingList, $emailPrefix) { @@ -39,7 +41,7 @@ class PostReceiveHook extends ReceiveHook /** * Find user name by nickname in users data file - * @param $user user nickname + * @param string $user user nickname * @return string user name */ public function getUserName($user) @@ -83,7 +85,7 @@ class PostReceiveHook extends ReceiveHook if ($ref['reftype'] == self::REF_TAG) { $this-sendTagMail($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); } elseif ($ref['reftype'] == self::REF_BRANCH){ -$this-sendBranchMail($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); +$this-branchesMailIds[$ref['refname']] = $this-sendBranchMail($ref['refname'], $ref['changetype'], $ref['old'], $ref['new']); } } @@ -91,12 +93,11 @@ class PostReceiveHook extends ReceiveHook foreach ($this-revisions as $revision = $branches) { // check if it commit was already in other branches if (!$this-isRevExistsInBranches($revision, array_diff($this-allBranches, $branches))) { -$this-sendCommitMail($revision); +$this-sendCommitMail($revision, $branches); } } } - /** * Send mail about branch. * Subject: [git] [branch] %PROJECT%: %STATUS% branch %BRANCH_NAME% @@ -119,10 +120,11 @@ class PostReceiveHook extends ReceiveHook * * --/part1-- * - * @param $name string branch fullname (refs/heads/example) - * @param $changeType int delete, create or update - * @param $oldrev string old revision - * @param $newrev string new revision + * @param string $name branch fullname (refs/heads/example) + * @param int $changeType delete, create or update + * @param string $oldrev old revision + * @param string $newrev new revision + * @return string mail uniq id */ private function sendBranchMail($name, $changeType, $oldrev, $newrev) { @@ -202,12 +204,13 @@ class PostReceiveHook extends ReceiveHook $mail-send(); +return $mail-getId(); } /** * Cache revisions per branche for use it later - * @param $branchName string branch fullname + * @param string $branchName branch fullname * @param array $revisions revisions array */ private function cacheRevisions($branchName, array $revisions) @@ -245,10 +248,10 @@ class PostReceiveHook extends ReceiveHook * %PATHS% * --/part1-- * - * @param $name string tag fullname (refs/tags/example) - * @param $changeType int delete, create or update - * @param $oldrev string old revision - * @param $newrev string new revision + * @param string $name tag fullname (refs/tags/example) + * @param int $changeType delete, create or update + * @param string $oldrev old revision + * @param string $newrev new revision */ private function sendTagMail($name, $changeType, $oldrev, $newrev) { @@ -321,7 +324,7 @@ class PostReceiveHook extends ReceiveHook * only for annotated tag: * 'tagger', 'tagger_email', 'tagger_date' - info about tagger person * 'log' - tag message - * @param $tag string tag fullname + * @param string $tag tag fullname * @return array array with tag info */ private function getTagInfo($tag) @@ -351,10 +354,10 @@ class
[PHP-CVS] [git] branch karma.git: update branch master
Branch master in karma.git was updated Date: Tue, 20 Mar 2012 08:10:26 + Link: http://git.php.net/?p=karma.git;a=log;h=11bc19461cfada676edd5852edc529532ef7a3ac;hp=42d233ae4752adbce2709553cef0cd456b92a2e0 Log: Commit: 11bc19461cfada676edd5852edc529532ef7a3ac Author: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:36:28 +0400 Committer: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:36:28 +0400 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=11bc19461cfada676edd5852edc529532ef7a3ac Shortlog: Add trivial merge. Commit: 9c54157ce5bcc8e2a414014ddd234efedd8d135c Author: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:31:31 +0400 Committer: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:31:31 +0400 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=9c54157ce5bcc8e2a414014ddd234efedd8d135c Shortlog: Remove not used methods -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit karma.git: lib/Git/PostReceiveHook.php
Commit: 11bc19461cfada676edd5852edc529532ef7a3ac Author: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:36:28 +0400 Committer: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:36:28 +0400 Parents: 9c54157ce5bcc8e2a414014ddd234efedd8d135c Link: http://git.php.net/?p=karma.git;a=commitdiff;h=11bc19461cfada676edd5852edc529532ef7a3ac Log: Add trivial merge. For merge commits without change any files (trivial merge) we not show changes path and diff in mail Changed paths: M lib/Git/PostReceiveHook.php Diff: 11bc19461cfada676edd5852edc529532ef7a3ac diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index da755f4..ee3aab7 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -518,7 +518,9 @@ class PostReceiveHook extends ReceiveHook } -if (strlen($pathsString) 8192) { +if ($pathsString == '') { +$message .= \nTrivial merge\n; +} elseif (strlen($pathsString) 8192) { // inline changed paths $message .= \nChanged paths:\n . $pathsString . \n; if ((strlen($pathsString) + strlen($diff)) 8192) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit karma.git: lib/Git/PostReceiveHook.php
Commit: 9c54157ce5bcc8e2a414014ddd234efedd8d135c Author: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:31:31 +0400 Committer: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:31:31 +0400 Parents: 42d233ae4752adbce2709553cef0cd456b92a2e0 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=9c54157ce5bcc8e2a414014ddd234efedd8d135c Log: Remove not used methods This methods was moved to bugsweb class early Changed paths: M lib/Git/PostReceiveHook.php Diff: 9c54157ce5bcc8e2a414014ddd234efedd8d135c diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index bd3be9b..da755f4 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -39,70 +39,6 @@ class PostReceiveHook extends ReceiveHook $this-allBranches = $this-getAllBranches(); } - -public function getReceivedMessages() -{ -$this-hookInput(); - -$paths = array_map( -function ($input) { -return $this-getReceivedMessagesForRange($input['old'], $input['new']); -}, -$this-refs); - -/* remove empty lines, and flattern the array */ -$flattend = array_reduce($paths, 'array_merge', []); -$paths= array_filter($flattend); - -return array_unique($paths); -} - -/** - * Returns an array of commit messages between revision $old and $new. - * - * @param string $old The old revison number. - * @parma string $new The new revison umber. - * - * @return array - */ -private function getReceivedMessagesForRange($old, $new) -{ -$repourl = \Git::getRepositoryPath(); -$output = []; - -if ($old == '') { -$cmd = sprintf( -%s --git-dir=%s for-each-ref --format='%%(refname)' 'refs/heads/*', -self::GIT_EXECUTABLE, -$repourl -); -exec($cmd, $output); - -/* do we have heads? otherwise it's a new repo! */ -$heads = implode(' ', $output); -$not = count($output) 0 ? sprintf('--not %s', escapeshellarg($heads)) : ''; -$cmd = sprintf( -'%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s %s', -\Git::GIT_EXECUTABLE, -$repourl, -$not, -escapeshellarg($new) -); -exec($cmd, $output); -} else { -$cmd = sprintf( -'%s --git-dir=%s log --pretty=format:[%%ae] %%H %%s %s..%s', -\Git::GIT_EXECUTABLE, -$repourl, -escapeshellarg($old), -escapeshellarg($new) -); -exec($cmd, $output); -} - -return $output; -} - /** * Find user name by nickname in users data file * @param string $user user nickname @@ -225,9 +161,6 @@ class PostReceiveHook extends ReceiveHook } } - - - $mail = new \Mail(); $mail-setSubject($this-emailPrefix . ' branch ' . $this-getRepositoryName() . ': ' . $status[$changeType] . ' branch ' . $shortname); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com karma: Remove the branch emails: lib/Git/PostReceiveHook.php
In sendBranchMail we call getBranchRevisions method. In this method we cache revisions in $this-revisions. So now we have $this-revisions empty, because remove sendBranchMail call. With regards, Alexander Moskaliov ir...@irker.net 2012/3/20 David Soria Parra d...@php.net sendBranchMail -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php