Project

General

Profile

Gerrit » History » Revision 9

Revision 8 (neels, 05/12/2016 11:46 AM) → Revision 9/130 (neels, 05/14/2016 03:00 AM)

h1. Contributing using Gerrit 

 Gerrit is a review tool that integrates nicely with git and ssh. Instead of manually uploading a change, one can push it for review. One can use ssh to trigger review and actions. 

 h2. Subprojects using Gerrit 

 The following projects use Gerrit to contribute changes: 

 * libosmocore.git 
 * libosmo-abis.git 
 * libosmo-netif.git 
 * libosmo-sccp.git 
 * libsmpp34.git 
 * openbsc.git 
 * osmo-bts.git 
 * osmo-iuh.git 
 * osmo-pcu.git 
 * cellmgr-ng.git 
 * osmo-sip-connector.git 
 
 h2. Configuring Gerrit/Account 

 You will need to sign-up at https://gerrit.osmocom.org/login/. If you have an Osmocom Redmine account you can use https://osmocom.org/openid as OpenID provider. After the initial sign-up you will need to: 

 * Pick a username (can not be changed) 
 * Add your public ssh key(s) 
 * Add email addresses you intend to use as author/comitter 

 h2. Setting up Gerrit for commits and pushing 

 * Add the remote to be able to fetch and push to gerrit 
 * Fetch the commit hook that adds Change-Id to each commit to uniquely identify a commit 

 <pre> 
 USERNAME=gerrit_user_name 
 PROJECT=$(basename $PWD) 
 git remote add gerrit ssh://$USERNAME@gerrit.osmocom.org:29418/$PROJECT.git 
 scp -P 29418 $USERNAME@gerrit.osmocom.org:hooks/commit-msg .git/hooks/ 
 </pre> 

 * In case your local username matches the gerrit username, the setup shortens to 

 <pre> 
 PROJECT=$(basename $PWD) 
 git remote add gerrit ssh://gerrit.osmocom.org:29418/$PROJECT.git 
 scp -P 29418 gerrit.osmocom.org:hooks/commit-msg .git/hooks/ 
 </pre> 

 Then 

 * Push for review 
 <pre> 
 git push gerrit HEAD:refs/for/master 
 </pre> 

 * Push a user branch 
 <pre> 
 git push gerrit HEAD:refs/heads/users/$USERNAME/topic HEAD:refs/users/$USERNAME/topic 
 </pre> 

 * Directly push to master if you are allowed to 
 <pre> 
 git push gerrit HEAD:refs/heads/master 
 </pre> 

 * List changesets in gerrit 
 <pre> 
 git ls-remote gerrit changes/* 
 </pre>
Add picture from clipboard (Maximum size: 48.8 MB)