blob: 7516e6b380c3cb1a8386f2342debe6b2ff0fb41b [file] [log] [blame] [view]
Andrew Gerrand5bc444d2014-12-10 11:35:11 +11001Be sure to familiarize yourself with the [code review process](http://golang.org/doc/contribute.html#Code_review) from the official Contribution Guidelines first.
2
3# Reviewer Parlance
4
5There are several terms code reviews may use that you should become familiar with.
6
Josh Bleecher Snyderb8f44562015-01-09 16:40:56 -08007 * ` LGTM ` looks good to me
8 * ` SGTM ` sounds good to me
9 * ` s/foo/bar/ ` please replace ` foo ` with ` bar `; this is [sed syntax](http://en.wikipedia.org/wiki/Sed#Usage).
10 * ` s/foo/bar/g ` please replace ` foo ` with ` bar ` throughout your entire change
Andrew Gerrand81bd6f92016-02-08 13:55:38 +110011 * `R=foo` these messages are directives for the [Go release dashboard](https://swtch.com/godash/).
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110012
13# Email
14
15Messages from a code review are typically sent to three places:
minux3bb258e2014-12-10 23:23:42 -080016 * the reviewers, if any
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110017 * the golang-codereviews group
minux3bb258e2014-12-10 23:23:42 -080018 * the owner
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110019
Josh Bleecher Snyderb8f44562015-01-09 16:40:56 -080020Please do NOT reply code review via email, as the message [will not be relayed to Gerrit](https://code.google.com/p/gerrit/issues/detail?id=228). Always click on the link and post reply in Gerrit.
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110021
Josh Bleecher Snyder5868b9f2015-02-03 14:49:20 -080022# Work in progress
23
Francesc Campoyc7b68222016-11-01 10:50:29 -070024If you have changes that aren't ready to be reviewed, you can put a giant **`DO NOT REVIEW`** as the second line of the CL description, so that people who see it know not to look any further. Don't make it the first line, since then it will become the subject for the entire review, even after you've changed the description.
Francesc Campoy72ebc112016-11-01 10:49:00 -070025
Francesc Campoyc7b68222016-11-01 10:50:29 -070026Similarly, if you would like to ensure that your changes are not merged by mistake, you can put **`DO NOT SUBMIT`** as the second line of the CL description.
Josh Bleecher Snyder5868b9f2015-02-03 14:49:20 -080027
bitlux85f23392015-12-14 14:36:41 -050028If you don't need Gerrit's features, but just want to backup your work, share work between multiple clients, or have a staging UI to examine your changes, you can use a regular git remote.
Josh Bleecher Snyder5868b9f2015-02-03 14:49:20 -080029
30To use GitHub as a git remote, you can either fork github.com/golang/go or create a new repo. There are trade-offs. Forked repos will have a faster first push. Non-forked repos can be private. Forked repos are associated in GitHub's system. As a result, they are easily discoverable and support cross-repo comparisons in the GitHub UI; however, this also means that references to issues in commit messages in forked repos will create references to your fork in the issue.
31
32To add your git remote, run something like:
33
34```bash
Josh Bleecher Snyderdb54ef42015-02-03 15:32:45 -080035$ git remote add fork git@github.com:yourusername/go.git
Josh Bleecher Snyder5868b9f2015-02-03 14:49:20 -080036```
37
38You can then push changes to the "fork" remote with `git push fork branchname`.
39
40Gerrit's code review model is to rewrite a single commit until it is correct. GitHub will try to prevent you from accidentally overwriting your existing branch. You can work around this by forcing the push: `git push --force fork branchname`. Alternatively, you can set up your forked remote as a mirror by cloning it initially with:
41
42```bash
Josh Bleecher Snyderdb54ef42015-02-03 15:32:45 -080043$ git remote add --mirror=push fork git@github.com:yourusername/go.git
Josh Bleecher Snyder5868b9f2015-02-03 14:49:20 -080044```
45
alexbrainmanc5d2ff62015-02-05 14:20:32 +110046Then running `git push fork` will update GitHub to perfectly mirror *everything* (all branches, all tags, etc.). This is handy, but take care when using this on multiple clients. You are bypassing the usual git safeguards, so it is easy to overwrite (and thus lose) work pushed by a different client.