1Gerrit is the code review system in use, making it easier
2for all of us to contribute with code and comments. This
3means there are no GitHub Pull Requests to open or emails
4with patches to send.
5
6Instead, sign in to Gerrit at http://review.couchbase.org/
7
8Review the [Individual Contributor Agreement](http://review.couchbase.org/static/individual_agreement.html)
9and agree to it in http://review.couchbase.org/#/settings/agreements
10
11Feel free to check out the [Couchnode project](http://review.couchbase.org/#/q/status:open+project:couchnode)
12and join us on IRC at [#libcouchbase on Freenode](https://webchat.freenode.net?channels=%23libcouchbase).
13
14When submitting a patch, add at least Brett Lawson (brett19@gmail.com)
15as a reviewer for it. He'll know who else to add and do that for you.
16
17# `repo`
18
19Gerrit integrates well with `repo` - a tool built on top of Git to help
20manage repositories and handle uploads to revision control. You can
21download it from https://storage.googleapis.com/git-repo-downloads/repo
22and put it in your PATH.
23
24All you need to do for your local development environment should be:
25
26    $ mkdir sdk
27    $ cd sdk
28
29    $ repo init -u git://github.com/couchbase/manifest.git -m couchnode/master.xml
30    $ repo sync
31
32    $ repo start branch-name --all
33    $ make install
34
35You must have a C and C++ compiler installed,
36automake, autoconf, Node and v8.
37
38If you are making any changes to the project, just commit them
39and upload to Gerrit by running:
40
41    $ repo upload
42
43If you experience trouble with your login name not matching the one
44that is set at http://review.couchbase.org/#/settings/ all you need
45to do is add your username to your Git configuration:
46
47    $ git config --global review.review.couchbase.org.username trond
48
49You can read the Repo Command Reference at https://source.android.com/setup/develop/repo
50to learn more about how it fits together with Gerrit.
51
52# Pure Git
53
54Alternatively, you can also contribute using pure Git. In order to push
55to Gerrit, your commit message needs a ChangeId reference edded. Set up
56a local commit message hook in order to automatically do that:
57
58    $ curl -Lo .git/hooks/commit-msg http://review.couchbase.org/tools/hooks/commit-msg
59    $ chmod +x .git/hooks/commit-msg
60
61If you already committed before setting up the hook, amend your commit:
62
63    $ git commit --amend
64
65Depending on whether you configured
66[SSH](http://review.couchbase.org/#/settings/ssh-keys) or
67[HTTP](http://review.couchbase.org/#/settings/http-password)
68authentication on your account in Gerrit,
69pushing changes is as simple as one of the following `git push` calls:
70
71    $ git push http://trond@review.couchbase.org/couchnode.git HEAD:refs/for/master
72    $ git push ssh://trond@review.couchbase.org:29418/couchnode.git HEAD:refs/for/master
73
74You might want to configure a remote as to easily `git push review`:
75
76    $ git config remote.review.url ssh://trond@review.couchbase.org:29418/couchnode.git
77    $ git config remote.review.push HEAD:refs/for/master
78
79You can read more details about how to use plain Git with Gerrit at
80http://review.couchbase.org/Documentation/user-upload.html
81