Permalink
Newer
Older
100644 57 lines (38 sloc) 2.43 KB
1
# Contributing to Cockroach
2
3
### Getting and building
4
5
### Assumed
6
* A working GCC (on mac os x something like `xcode-select --install` will get you started)
7
* [Go environment](http://golang.org/doc/code.html)
8
* [prerequisites for building
9
RocksDB](https://github.com/cockroachdb/rocksdb/blob/master/INSTALL.md)
10
* [protoc](https://github.com/google/protobuf/releases)
11
* pkgconfig
12
* curl
13
14
If you're on Mac OS X, [homebrew](http://brew.sh/) can be very helpful to fulfill these dependencies.
15
16
```bash
Andrew Bonventre
Sep 7, 2014
17
mkdir -p $GOPATH/src/github.com/cockroachdb/
18
cd $GOPATH/src/github.com/cockroachdb/
19
git clone git@github.com:cockroachdb/cockroach.git
20
cd cockroach
21
./bootstrap.sh
22
make
23
```
24
25
### Style guide
26
We're following the [Google Go Code Review](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) fairly closely. In particular, you want to watch out for proper punctuation and capitalization and make sure that your lines stay well below 80 characters.
27
Andrew Bonventre
Sep 7, 2014
28
### Code review workflow
Sep 10, 2014
30
+ Create a local feature branch to do work on, ideally on one thing at a time.
31
If you are working on your own fork, see
32
[this tip](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
33
on forking in Go, which ensures that Go import paths will be correct.
Andrew Bonventre
Sep 7, 2014
35
`git checkout -b andybons/update-readme`
36
Andrew Bonventre
Sep 7, 2014
37
+ Hack away and commit your changes locally using `git add` and `git commit`.
38
Andrew Bonventre
Sep 7, 2014
39
`git commit -a -m 'update CONTRIBUTING.md'`
40
Sep 10, 2014
41
+ When you’re ready for review, create a remote branch from your local branch. You may want to `git fetch origin` and run `git rebase origin/master` on your local feature branch before.
42
Andrew Bonventre
Sep 7, 2014
43
`git push -u origin andybons/update-readme`
44
Andrew Bonventre
Sep 7, 2014
45
+ Then [create a pull request using GitHub’s UI](https://help.github.com/articles/creating-a-pull-request).
Sep 10, 2014
46
47
+ Address feedback in new commits. Wait (or ask) for new feedback on those commits if they are not straightforward.
48
49
+ Once ready to land your change, squash your commits. Where n is the number of commits in your branch, run
50
`git rebase -i HEAD~n`
51
52
and subsequently update your remote (you will have to force the push, `git push -f andybons mybranch`). The pull request will update.
53
54
+ If you do not have write access to the repository and your pull request requires a manual merge, you may be asked to rebase again,
55
`git fetch origin; git rebase -i origin/master` and update the PR again. Otherwise, you are free to merge your branch into origin/master directly or rebase first as you deem appropriate.
56