Project

General

Profile

Gerrit » History » Version 8

neels, 05/12/2016 11:46 AM

1 1 zecke
h1. Contributing using Gerrit
2
3
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.
4
5
h2. Subprojects using Gerrit
6
7
The following projects use Gerrit to contribute changes:
8
9
* libosmocore.git
10
* libosmo-abis.git
11
* libosmo-netif.git
12 4 zecke
* libosmo-sccp.git
13 1 zecke
* libsmpp34.git
14
* openbsc.git
15
* osmo-bts.git
16
* osmo-iuh.git
17
* osmo-pcu.git
18
* cellmgr-ng.git
19 5 zecke
* osmo-sip-connector.git
20 1 zecke
 
21
h2. Configuring Gerrit/Account
22
23
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:
24
25
* Pick a username (can not be changed)
26
* Add your public ssh key(s)
27
* Add email addresses you intend to use as author/comitter
28
29
h2. Setting up Gerrit for commits and pushing
30
31 2 zecke
* Add the remote to be able to fetch and push to gerrit
32
* Fetch the commit hook that adds Change-Id to each commit to uniquely identify a commit
33
34
<pre>
35 7 neels
USERNAME=gerrit_user_name
36
PROJECT=$(basename $PWD)
37
git remote add gerrit ssh://$USERNAME@gerrit.osmocom.org:29418/$PROJECT.git
38
scp -P 29418 $USERNAME@gerrit.osmocom.org:hooks/commit-msg .git/hooks/
39
</pre>
40
41
* In case your local username matches the gerrit username, the setup shortens to
42
43
<pre>
44
PROJECT=$(basename $PWD)
45
git remote add gerrit ssh://gerrit.osmocom.org:29418/$PROJECT.git
46
scp -P 29418 gerrit.osmocom.org:hooks/commit-msg .git/hooks/
47
</pre>
48
49
Then
50
51
* Push for review
52
<pre>
53
git push gerrit HEAD:refs/for/master
54
</pre>
55
56
* Push a user branch
57
<pre>
58 8 neels
git push gerrit HEAD:refs/users/$USERNAME/topic
59 7 neels
</pre>
60
61
* Directly push to master if you are allowed to
62
<pre>
63
git push gerrit HEAD:refs/heads/master
64
</pre>
65
66
* List changesets in gerrit
67
<pre>
68
git ls-remote gerrit changes/*
69 2 zecke
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)