Permalink
Nov 3, 2014
Nov 3, 2014
Sep 7, 2014
Sep 7, 2014
Newer
100644
63 lines (40 sloc)
2.88 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)
9
10
If you're on Mac OS X, [homebrew](http://brew.sh/) can be very helpful to fulfill these dependencies.
11
15
mkdir -p $GOPATH/src/github.com/cockroachdb/
16
cd $GOPATH/src/github.com/cockroachdb/
17
git clone git@github.com:cockroachdb/cockroach.git
18
cd cockroach
21
Now you should be all set for `make build`, `make test` and everything else our Makefile has to
22
offer. Note that the first time you run `make` various dependent libraries and tools will be
23
downloaded and installed which can be somewhat time consuming. Be patient.
25
Note that if you edit a `.proto` file you will need to manually regenerate the associated
26
`.pb.{go,cc,h}` files using `go generate`.
27
28
To add or update a dependency, use `go get -u` and then
29
`glock save github.com/cockroachdb/cockroach` and commit the changes to the GLOCKFILE.
30
31
### Style guide
32
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.
33
37
If you are working on your own fork, see
38
[this tip](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
39
on forking in Go, which ensures that Go import paths will be correct.
47
+ 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.
51
+ Then [create a pull request using GitHub’s UI](https://help.github.com/articles/creating-a-pull-request).
52
53
+ Address feedback in new commits. Wait (or ask) for new feedback on those commits if they are not straightforward.
54
55
+ Once ready to land your change, squash your commits. Where n is the number of commits in your branch, run
56
`git rebase -i HEAD~n`
57
58
and subsequently update your remote (you will have to force the push, `git push -f andybons mybranch`). The pull request will update.
59
60
+ 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,
61
`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.
62