Working with Git and Gerrit » History » Version 27

Karsten Dambekalns, 2010-08-24 11:06

1 1 Karsten Dambekalns
h1. Working with Git and Gerrit Code Review
2 22 Karsten Dambekalns
3
{{>toc}}
4 1 Karsten Dambekalns
5
For FLOW3 and TYPO3 Phoenix we are using Git and the Gerrit Code Review system to channel commits for review.
6 20 Karsten Dambekalns
7 26 Karsten Dambekalns
Here is what you need to know to contribute, more details on Git are available in the "Pro Git book":http://progit.org/book/, the "Gerrit documentation":https://review.typo3.org/Documentation/index.html and other resources.
8 1 Karsten Dambekalns
9 26 Karsten Dambekalns
h2. Quickstart Guides
10 1 Karsten Dambekalns
11 26 Karsten Dambekalns
* For a quick "Getting Started" guide, see the [[Gerrit and Git Quickstart]]
12
* Here is a transcript of a session [[Cloning the FLOW3 Base Distribution]]
13
* Here is a transcript of a session [[Cloning the TYPO3 Phoenix Base Distribution]]
14 25 Sebastian Kurfuerst
15 26 Karsten Dambekalns
*Note:* Take time to learn and explore git and gerrit!
16
17 1 Karsten Dambekalns
h2. Git
18 24 Karsten Dambekalns
19 1 Karsten Dambekalns
h3. [[Working with Git]]
20
21 24 Karsten Dambekalns
h2. Gerrit Code Review
22 1 Karsten Dambekalns
23
h3. Registering with gerrit
24
25 26 Karsten Dambekalns
To register with gerrit, you need to have an account on typo3.org. Then visit https://review.typo3.org/ and log in using your typo3.org username and password. Click on 'Settings' -> 'Profile', and check that gerrit correctly knows your name and email address (it should; if not it might take a while for the synchronization to take place).
26 1 Karsten Dambekalns
27
In order to be able to upload code, you now need to create a ssh key that gerrit can use to identify you, or tell gerrit about one that already exists.
28
29
To create a new ssh key, if you don't already have one, run
30
<pre>ssh-keygen -t dsa -f ~/.ssh/id_dsa</pre>
31
The public key for this is now stored in ~/.ssh/id_dsa.pub.
32 23 Karsten Dambekalns
33
To tell gerrit about your key, log in, and go to 'Settings'. Select 'SSH Keys', and paste your public key into the "Add SSH Public Key" box, or click on the 'Open Key...' option to load it from the filesystem. Click on 'Add' to add the new public key.
34 27 Karsten Dambekalns
35 1 Karsten Dambekalns
To make things easier, set up ssh so that it knows about the defaults for the gerrit server. Edit @~/.ssh/config@, and add a section like:
36
<pre>Host review.typo3.org 
37 23 Karsten Dambekalns
User <username> 
38 1 Karsten Dambekalns
IdentityFile ~/.ssh/id_dsa 
39
Port 29418</pre>
40 23 Karsten Dambekalns
(where <username> is what you logged in with, i.e. your typo3.org username)
41 1 Karsten Dambekalns
42 23 Karsten Dambekalns
To verify your ssh key is working correctly, try using an ssh client to connect to gerrit. You should get the following output if it all works:
43 1 Karsten Dambekalns
<pre>$ ssh review.typo3.org
44 23 Karsten Dambekalns
gerrit: no shell available
45
Connection to review.typo3.org closed.</pre>
46 4 Karsten Dambekalns
47 24 Karsten Dambekalns
h3. [[Working with Gerrit as a Developer]]
48 4 Karsten Dambekalns
49 24 Karsten Dambekalns
h3. [[Working with Gerrit as a Reviewer]]
50 4 Karsten Dambekalns
51
h2. Thanks
52 1 Karsten Dambekalns
53
... to the folks over at "OpenAFS":http://openafs.org/ that made us stumble over gerrit and whose wiki page we shamelessly used as a base for this page.
54 2 Karsten Dambekalns
55
... to Sebastian Kurf├╝rst, Peter Niederlag, Christopher Hlubek for their help with git, gerrit and redmine.
56
57 23 Karsten Dambekalns
... Bastian Waidelich for being the brave Windows test user.
58 26 Karsten Dambekalns
59
... to Shawn Pearce for being helpful on the gerrit mailing list.
60 5 Karsten Dambekalns
61 1 Karsten Dambekalns
... to the TYPO3 Core Team for being open towards a change in SCM flavor.