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