Community
Participate
Working Groups
I'd like to relax the update hook to allow committers to push commits from other committers within their project. Currently, the hook examines each commit to make sure it was performed by the committer doing the push. The hook should instead examine each of the commits and if the commits are done by a committer on the project, it should pass though regardless of who is doing the push. This will allow projects to commit to shared local Git repos and push/merge in batches. In an offline discussion with Wayne and Janet, we agreed this approach was sane.
I've tested out the changes, and so far it works. Although I, as a committer, own the files in a repo, because it is owned by a group that I am not part of, I am refused a push: remote: remote: error: git.eclipse.org does not know this committer, remote: or this this committer cannot commit to this project (gid=8694 repo:org.eclipse.babel.server): droy. remote: remote: denied: You (denis.roy@eclipse.org) cannot push changes that were not committed by you or members of your project. Please fix your repository, and see http://wiki.eclipse.org/Git for information on configuring your Git environment. remote: remote: error: hook declined to update refs/heads/master I need to test this with multiple commit transactions in one push.
I put two good commits (Kit Lo and myself) and two bad ones: commit 08f8ac6cf9ffaec4d8b551cbe7d75724cf5d6796 Author: Denis Roy <someone.somewhere@somesite.com> Date: Fri Aug 19 16:33:24 2011 -0400 kjaskjsda commit bec9b0a2749f9d2bab3a3636b0fa2333c5d67194 Author: Denis Roy <kitlo@HIDDEN> Date: Fri Aug 19 16:31:40 2011 -0400 asjkaskj commit abad936abbe66f0890e90168da425153e05ce448 Author: Denis Roy <matt.ward@HIDDEN> Date: Fri Aug 19 16:31:20 2011 -0400 jhasas commit ab609531e06ddd39bd2d9ce076663dab2ce126e7 Author: Denis Roy <denis.roy@HIDDEN> Date: Fri Aug 19 16:31:02 2011 -0400 denis $ git push origin master Counting objects: 14, done. Delta compression using up to 3 threads. Compressing objects: 100% (12/12), done. Writing objects: 100% (12/12), 1.06 KiB, done. Total 12 (delta 8), reused 0 (delta 0) remote: remote: error: git.eclipse.org does not know this committer, remote: or this this committer cannot commit to this project (gid=8536 repo:org.eclipse.babel.server): mward. remote: error: git.eclipse.org does not know this committer, remote: or this this committer cannot commit to this project (gid=8536 repo:org.eclipse.babel.server): someone.somewhere@somesite.com. remote: remote: denied: You (denis.roy@HIDDEN) cannot push changes that were not committed by you or members of your project. Please fix your repository, and see http://wiki.eclipse.org/Git for information on configuring your Git environment. remote: remote: error: hook declined to update refs/heads/master Is the Birt project willing to give this new hook a try?
According to my test, we still can't push COMMITS from multiple comitters : 1. I put two good commits in my local repo (xgu@actuate.com and mwu@actuate.com are both birt project commiters): $ git log commit 3b93bda816a5fbb6e9bb2c7f11b6416c02a64cbc Author: mwu <mwu@actuate.com> Date: Sat Aug 20 13:25:33 2011 +0800 test git rule - mwu commit bf38071ebaace3da3ac17695831480184372ff8e Author: xgu <xgu@actuate.com> Date: Sat Aug 20 13:24:12 2011 +0800 test git rule - xgu 2. push to eclipse repo by xgu: $ git push Counting objects: 13, done. Delta compression using up to 8 threads. Compressing objects: 100% (8/8), done. Writing objects: 100% (10/10), 756 bytes, done. Total 10 (delta 6), reused 0 (delta 0) remote: remote: error: git.eclipse.org does not know this committer, remote: or this is not you: mwu@actuate.com. remote: remote: denied: You (xgu@actuate.com) cannot push changes that were not committed by you. Please fix your repository, and see http://wiki.eclipse.org/Git for information on configuring your Git environment. remote: remote: error: hook declined to update refs/heads/master To ssh://xgu@git.eclipse.org/gitroot/birt/org.eclipse.birt.git ! [remote rejected] master -> master (hook declined) error: failed to push some refs to 'ssh://xgu@git.eclipse.org/gitroot/birt/org.eclipse.birt.git'
> According to my test, we still can't push COMMITS from multiple comitters : Yong, I had not put the new hook in place since I wanted to confirm with you first. The new hook si there now; feel free to try your push again. Thanks
Passed test, now we can push COMMITS from multiple comitters and deny COMMITS from non project comitters. Thanks for you help.
Fantastic. I've deployed the hook to all the projects, updated the Wiki docs and sent an email to the committers list to spread the news.