Search code examples
gitapachegit-pushgerrit

gerrit didn't work. I still can bypass reviewer


When I use git push origin HEAD:refs/for/branch_name, it works normally. But I use git push origin HEAD:branch_name, it can bypass reviewer and push the code into server directly. It's weird! It shall show: prohibited by gerrit. Can anybody else help me??

My Apache2 httpd.conf is shown as below

<VirtualHost *>  
  ServerName localhost 
  ProxyRequests Off  
  ProxyVia Off  
  ProxyPreserveHost On  

  <Proxy *>  
        Order deny,allow  
        Allow from all  
  </Proxy>  

  <Location /login/>  
     AuthType Basic  
     AuthName "Gerrit Code Review"  
     AuthBasicProvider file  
     AuthUserFile /home/kk/gerrit/server/etc/passwords  
     Require valid-user  
  </Location>  

  ProxyPass / http://10.10.68.224:9091/
  ProxyPassReverse / http://10.10.68.224:9091/
</VirtualHost>  

Solution

  • The gerrit documentation describes how the the review process may be by-passed by the project owner. Possible to restrict this permission, see the Push category in the access control section.