GOBIN
directory (by default $(go env GOPATH)/bin
) is in your PATH
.go version
./usr/local/go
, is on your PATH
.Sign one of the contributor license agreements below.
Run go get golang.org/x/review/git-codereview
to install the code reviewing tool.
Ensure it's working by running git codereview
(check your PATH
if not).
If you would like, you may want to set up aliases for git-codereview
, such that git codereview change
becomes git change
. See the godoc for details.
git-codereview
tool, please note that all error messages will assume that you have set up these aliases.Change to a directory of your choosing and clone the repo.
cd ~/code git clone https://code.googlesource.com/google-api-go-client
If you have already checked out the source, make sure that the remote git
origin
is https://code.googlesource.com/google-api-go-client:
git remote -v # ... git remote set-url origin https://code.googlesource.com/google-api-go-client
The project uses Go Modules for dependency management See gopls
for making your editor work with modules.
Change to the project directory:
cd ~/code/google-api-go-client
Make sure your git
auth is configured correctly by visiting https://code.googlesource.com, clicking “Generate Password” at the top-right, and following the directions. Otherwise, git codereview mail
in the next step will fail.
Now you are ready to make changes. Don't create a new branch or make commits in the traditional way. Use the followinggit codereview
commands to create a commit and create a Gerrit CL:
git codereview change <branch-name> # Use this instead of git checkout -b <branch-name> # Make changes. git add ... git codereview change # Use this instead of git commit git codereview mail # If this fails, the error message will contain instructions to fix it.
git
branch for you to develop on. Once your change is merged, you can delete this branch.As you make changes for code review, ammend the commit and re-mail the change:
# Make more changes. git add ... git codereview change git codereview mail
Warning: do not change the Change-Id
at the bottom of the commit message - it‘s how Gerrit knows which change this is (or if it’s new).
When you fixes issues from code review, respond to each code review message then click Reply at the top of the page.
Each new mailed amendment will create a new patch set for your change in Gerrit. Patch sets can be compared and reviewed.
Note: if your change includes a breaking change, our breaking change detector will cause CI/CD to fail. If your breaking change is acceptable in some way, add a BREAKING_CHANGE_ACCEPTABLE=<reason>
line to the commit message to cause the detector not to be run and to make it clear why that is acceptable.
Finally, add reviewers to your CL when it‘s ready for review. Reviewers will not be added automatically. If you’re not sure who to add for your code review, add deklerk@, tbp@, cbro@, and codyoss@.
Before we can accept your pull requests you'll need to sign a Contributor License Agreement (CLA):
You can sign these electronically (just scroll to the bottom). After that, we'll be able to accept your pull requests.
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the Contributor Covenant, version 1.2.0, available at http://contributor-covenant.org/version/1/2/0/