The branch, PHP_POST_RECEIVE on karma.git has been updated via 46adcc9c1571d5a20660ca49b2762189a1495786 (commit) from c7163b23683f8656f913ff4d22706ca5a5f41380 (commit)
http://git.php.net/?p=karma.git;a=log;h=46adcc9c1571d5a20660ca49b2762189a1495786;hp=c7163b23683f8656f913ff4d22706ca5a5f41380 Summary of changes: README.POST_RECEIVE | 29 ++++++++++++++++++++++++++++- lib/Git/PostReceiveHook.php | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) -- Log ---------------------------------------- commit 46adcc9c1571d5a20660ca49b2762189a1495786 Author: Alexander Moskaliov <ir...@php.net> Date: Wed Mar 7 12:32:12 2012 +0400 add situatuions for mail per commit diff --git a/README.POST_RECEIVE b/README.POST_RECEIVE index fe0a666..522ff1f 100644 --- a/README.POST_RECEIVE +++ b/README.POST_RECEIVE @@ -79,4 +79,31 @@ Tag mail: ------------ Commit mail: - (Realization of this part in progress) \ No newline at end of file + (Realization of this part in progress) + + 1 - 2 - 3 - A (pushed, but not new branch) + + 5 - 2 - 6 - B (pushed, but not new branch) + + 3 - 5 - 7 - C (already on server) + + We must check was every commit on repository before or not. + git rev-list --max-count=1 REV --not ALL BRANCHES EXCEPT PUSHED BRANCHES WITH THIS COMMIT + If result empty - this commit already was pushed in one of others repository. + Examples: + for 2 rev : we send mail + for 3 rev : we not send mail, because it already in C branch + + + 1 - 2 - 3 - A (pushed) + \ + 4 - 5 - B (pushed, new) + + 6 - 7 - 8 - C (already on server) + + We must mark 1 commit as commit in branches A and B. + If we didn't it and run "git rev-list --max-count=1 sha_for_1_commit --not B C" we get wrong result, + because commit 1 also in B branch. + For this we get "old" revision of every updated branch and check if it placed in every new branches. + If it is we mark all revisions between "old" of updated branch and "new" of new branch as revision also from new branch. + So we get this command "git rev-list --max-count=1 sha_for_1_commit --not C" diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index c34a55b..c515358 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -82,7 +82,7 @@ class PostReceiveHook extends ReceiveHook if ($branch['changetype'] != self::TYPE_DELETED) { if ($branch['changetype'] == self::TYPE_UPDATED) { - // check if push was with --forced option + // check if push was with --force option if ($replacedRevisions = $this->getRevisions($branch['new'] . '..' . $branch['old'])) { $message .= "Discarded revisions: \n" . implode("\n", $replacedRevisions) . "\n"; } Thank you for your contribution. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php