Permalink
Newer
Older
100644 45 lines (29 sloc) 1.9 KB
1
# Contributing to Cockroach
2
3
### Getting and building
4
5
A working [Go environment](http://golang.org/doc/code.html) and [prerequisites for building
6
RocksDB](https://github.com/cockroachdb/rocksdb/blob/master/INSTALL.md) are both presumed.
7
```bash
Andrew Bonventre
Sep 7, 2014
8
mkdir -p $GOPATH/src/github.com/cockroachdb/
9
cd $GOPATH/src/github.com/cockroachdb/
10
git clone git@github.com:cockroachdb/cockroach.git
11
cd cockroach
12
./bootstrap.sh
13
make
14
```
15
Andrew Bonventre
Sep 7, 2014
16
### Code review workflow
Sep 10, 2014
18
+ Create a local feature branch to do work on, ideally on one thing at a time.
19
If you are working on your own fork, see
20
[this tip](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
21
on forking in Go, which ensures that Go import paths will be correct.
Andrew Bonventre
Sep 7, 2014
23
`git checkout -b andybons/update-readme`
24
Andrew Bonventre
Sep 7, 2014
25
+ Hack away and commit your changes locally using `git add` and `git commit`.
26
Andrew Bonventre
Sep 7, 2014
27
`git commit -a -m 'update CONTRIBUTING.md'`
28
Sep 10, 2014
29
+ 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.
30
Andrew Bonventre
Sep 7, 2014
31
`git push -u origin andybons/update-readme`
32
Andrew Bonventre
Sep 7, 2014
33
+ Then [create a pull request using GitHub’s UI](https://help.github.com/articles/creating-a-pull-request).
Sep 10, 2014
34
35
+ Address feedback in new commits. Wait (or ask) for new feedback on those commits if they are not straightforward.
36
37
+ Once ready to land your change, squash your commits. Where n is the number of commits in your branch, run
38
`git rebase -i HEAD~n`
39
40
and subsequently update your remote (you will have to force the push, `git push -f andybons mybranch`). The pull request will update.
41
42
+ 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,
43
`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.
44