Permalink
Nov 3, 2014
Sep 7, 2014
Sep 7, 2014
Newer
100644
61 lines (39 sloc)
2.65 KB
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
* [protoc](https://github.com/google/protobuf/releases)
9
* pkgconfig
10
* curl
11
12
If you're on Mac OS X, [homebrew](http://brew.sh/) can be very helpful to fulfill these dependencies.
13
14
You can `go get -d github.com/cockroachdb/cockroach` and then run `./bootstrap.sh` or, alternatively,
15
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
24
Now you should be all set for `make build`, `make test` and everything else our Makefile has to offer.
25
26
Note that if you edit a `.proto` file you will need to manually regenerate the associated
27
`.pb.{go,cc,h}` files using `go generate`.
28
29
### Style guide
30
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.
31
35
If you are working on your own fork, see
36
[this tip](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
37
on forking in Go, which ensures that Go import paths will be correct.
45
+ 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.
49
+ Then [create a pull request using GitHub’s UI](https://help.github.com/articles/creating-a-pull-request).
50
51
+ Address feedback in new commits. Wait (or ask) for new feedback on those commits if they are not straightforward.
52
53
+ Once ready to land your change, squash your commits. Where n is the number of commits in your branch, run
54
`git rebase -i HEAD~n`
55
56
and subsequently update your remote (you will have to force the push, `git push -f andybons mybranch`). The pull request will update.
57
58
+ 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,
59
`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.
60