The branch, PHP_POST_RECEIVE on karma.git has been updated via 67c322fe22b0cb6f561711a4041325974b9bfc31 (commit) from b841aacab5e1e9af103b1d38e11822debda5ea22 (commit)
http://git.php.net/?p=karma.git;a=log;h=67c322fe22b0cb6f561711a4041325974b9bfc31;hp=b841aacab5e1e9af103b1d38e11822debda5ea22 Summary of changes: README.POST_RECEIVE | 84 +++++++++++++++++++++++++++++++++++++++++++ lib/Git/PostReceiveHook.php | 37 ------------------- 2 files changed, 84 insertions(+), 37 deletions(-) create mode 100644 README.POST_RECEIVE -- Log ---------------------------------------- commit 67c322fe22b0cb6f561711a4041325974b9bfc31 Author: Alexander Moskaliov <ir...@php.net> Date: Tue Mar 6 22:46:15 2012 +0400 Move git push situations description to README diff --git a/README.POST_RECEIVE b/README.POST_RECEIVE new file mode 100644 index 0000000..90a9f59 --- /dev/null +++ b/README.POST_RECEIVE @@ -0,0 +1,84 @@ +Post receive mail script solutions. + + +digits - commits, +chars - branches (except N & O) +N, O - new and old revisions in push per branch. + +------------ +Branch mail: +This part contains info only about mail per branch. For mail per commit logic different. + + + New branch (0..N): + + 1 - 2 - A (already on server) + \ + 3 - B (pushed) + + We get all commits reachable from new branche and not from all other branches: + git rev-list B --not A -> 3-B + + + 1 - 2 - A (only local) + \ + 3 - B (pushed) + + Because A branch not pushed on server before we need mail about all commits including 1-2. e.g. 1-B + + + 1 - 2 - 3 - 4 - A (already on server) + \ / + 5 - 6 - B (pushed) + + We can't know what we need also 5 commit in B, so we mailed only about B commit for this branch. + 2-6 commits was mailed in A branch. + + + 1 - 2 - 3 - A (already on server) + \ \ + 5 - 6 - B (pushed) + We can't know what we need also 3 commit in B mail... any ideas? + Now we send mail with 5-B commits only. + + + + Deleted branch (O..0): + + We don't care about revisions in deleted branch. (or care?) + + + Update branch (O..N): + + + 1 - 2 - O - 3 - 4 - N + + Maill full log between O and N. (e.g. 3-N) git rev-list O..N + + + 1 - 2 - N 1 - 2 - 3 - 4 - N + \\ or \\ + 3 - 4 - O 5 - 6 - O + + It's mean user used --force option for pull and remove previosly revisions. + (rewind N revision in first case and replace 5-O revisions by 4-N) + We can check it by command: git rev-list N..O. + If result of this command not empty - we have such cases. + If result of "git merge-base O N" will be equal N - we have first case. + We send mail with info about rewind or replace. + (Realization of this case in progress) + + +------------ +Tag mail: + + Add, delete and update tag: + If new(updated) tag is annotated - we write full info about it and target. + If it not annotated - only about commit. + + For old(removed) tag - we write only sha of old commit/tag. + + +------------ +Commit mail: + (Realization of this part in progress) \ No newline at end of file diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 195c8c2..49e5499 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -67,43 +67,6 @@ class PostReceiveHook extends ReceiveHook } - /* - * Note: - * * - commits in push, - * digits - simply commits - * chars - branches - * + - commits already in server git repository - * without + - commits in local git repository - * - * Situation #1. - * - * 1+ - 2* - A* - * \ - * 3* - B* - * - * Problem: we have 0-B for B branch in push input data. - * Solution: git rev-list B --not A -> 3-B (--not A C D E F ... all branches) - * - * Situation #2. - * 1 - 2 - A - * \ - * 3* - B* - * Problem: we will have 0-B in rev-list. - * Solution: ? - * - * Situation #3. - * - * 1+ - 2+ - 3+ - A+ - * \ / - * 4* - 5* - B* - * Problem: we will have 5-B in rev-list, but what about 4 commit? - * - * Solution: ? - * - * - * ... more problems - * - */ private function sendBranchMail(array $branch) { Thank you for your contribution. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php