- A working GCC (on mac os x something like
xcode-select --install
will get you started) - Go environment
- Git and Mercurial (for retrieving dependencies)
If you're on Mac OS X, homebrew can be very helpful to fulfill these dependencies.
You can go get -d github.com/cockroachdb/cockroach
or, alternatively,
mkdir -p $GOPATH/src/github.com/cockroachdb/
cd $GOPATH/src/github.com/cockroachdb/
git clone [email protected]:cockroachdb/cockroach.git
cd cockroach
Now you should be all set for make build
, make test
and everything else our Makefile has to
offer. Note that the first time you run make
various dependent libraries and tools will be
downloaded and installed which can be somewhat time consuming. Be patient.
Note that if you edit a .proto
file you will need to manually regenerate the associated
.pb.{go,cc,h}
files using go generate
.
To add or update a dependency, use go get -u
and then
glock save github.com/cockroachdb/cockroach
and commit the changes to the GLOCKFILE.
We're following the Google Go Code Review 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.
- Create a local feature branch to do work on, ideally on one thing at a time. If you are working on your own fork, see this tip on forking in Go, which ensures that Go import paths will be correct.
git checkout -b andybons/update-readme
- Hack away and commit your changes locally using
git add
andgit commit
.
git commit -a -m 'update CONTRIBUTING.md'
- When you’re ready for review, create a remote branch from your local branch. You may want to
git fetch origin
and rungit rebase origin/master
on your local feature branch before.
git push -u origin andybons/update-readme
-
Address feedback in new commits. Wait (or ask) for new feedback on those commits if they are not straightforward.
-
Once ready to land your change, squash your commits. Where n is the number of commits in your branch, run
git rebase -i HEAD~n
and subsequently update your remote (you will have to force the push, git push -f andybons mybranch
). The pull request will update.
- 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,
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.