From 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg
Before undertaking to write something new for the Go project, send
-mail to the mailing
+mail to the mailing
list to discuss what you plan to do. This gives everyone a
chance to validate the design, helps prevent duplication of effort,
and ensures that the idea fits inside the goals for the language
@@ -45,10 +45,14 @@ tree to make sure the changes don't break other packages or programs:
+(To build under Windows use
After running for a while, the command should print " Edit Edit
-cd $GOROOT/src
-./all.bash # On Windows, run all.bat
+$ cd go/src
+$ ./all.bash
+all.bat
.)
+ALL TESTS PASSED
".
Configure the extension
-$GOROOT/.hg/hgrc
to add:.hg/hgrc
in the root of your Go checkout to add:
[extensions]
-codereview = $GOROOT/lib/codereview/codereview.py
+codereview = /path/to/go/lib/codereview/codereview.py
[ui]
username = Your Name <you@server.dom>
@@ -110,6 +114,16 @@ The
username
information will not be used unless
you are a committer (see below), but Mercurial complains if it is missing.
+As the codereview extension is only enabled for your Go checkout, the remainder of this document assumes you +are inside the go directory when issuing commands. +
+ +To contribute to subrepositories, edit the .hg/hgrc
for each
+subrepository in the same way. For example, add the codereview extension to
+code.google.com/p/go.tools/.hg/hgrc
.
+
After adding the code review extension, you can run
@@ -126,16 +140,10 @@ $ hg help change
-As the codereview extension is only enabled for your checkout
-in $GOROOT
, the remainder of this document assumes you
-are inside $GOROOT
when issuing commands.
-
-Windows users may need to perform extra steps to get the code review +Windows users may need to perform extra steps to get the code review extension working. See the -CodeReview page -on the Go Wiki for details. +CodeReview page +on the Go Wiki for details.
CONTRIBUTORS
file.
You can create a Google Account
associated with any address where you receive email.
@@ -155,7 +163,6 @@ application-specific password and use that when prompted for a password.
-$ cd $GOROOT $ hg code-login Email (login for uploading to codereview.appspot.com): rsc@golang.org Password for rsc@golang.org: @@ -165,7 +172,7 @@ Saving authentication cookies to /Users/rsc/.codereview_upload_cookies_coderevie+Configure your account settings.
-Edit your code review settings. +
Edit your code review settings. Grab a nickname. Many people prefer to set the Context option to “Whole file” to see more context when reviewing changes. @@ -240,7 +247,7 @@ These can be code review nicknames or arbitrary email addresses. Unless explicitly told otherwise, such as in the discussion leading up to sending in the change list, leave the reviewer field blank. This means that the -golang-dev@googlegroups.com +golang-codereviews@googlegroups.com mailing list will be used as the reviewer.
@@ -270,7 +277,7 @@ After editing, the template might now read: # Lines beginning with # are ignored. # Multi-line values should be indented. -Reviewer: golang-dev@googlegroups.com +Reviewer: golang-codereviews@googlegroups.com CC: math-nuts@swtch.com Description: @@ -286,11 +293,11 @@ Files:The special sentence “Fixes issue 159.” associates -the change with issue 159 in the Go issue tracker. +the change with issue 159 in the Go issue tracker. When this change is eventually submitted, the issue tracker will automatically mark the issue as fixed. (These conventions are described in detail by the -Google Project Hosting Issue Tracker documentation.) +Google Project Hosting Issue Tracker documentation.)
@@ -302,7 +309,7 @@ which
hg change
will print, something like:-CL created: http://codereview.appspot.com/99999 +CL created: https://codereview.appspot.com/99999Adding or removing files from an existing change
@@ -448,7 +455,7 @@ lines blank and then run:-$ hg mail -r golang-dev@googlegroups.com --cc math-nuts@swtch.com 99999 +$ hg mail -r golang-codereviews@googlegroups.com --cc math-nuts@swtch.com 99999to achieve the same effect.
@@ -473,31 +480,33 @@ to send comments back.Revise and upload
-You will probably revise your code in response to the reviewer comments. When -you have done this, you can upload your change to the code review server -without sending a notification by running
hg upload
using the change -list number assigned duringhg change
+When you have revised the code and are ready for another round of review, +you can upload your change and send mail asking the reviewers to +please take another look (PTAL
). Use the change list number +assigned duringhg change
-$ hg upload 99999 +$ hg mail 99999+-When you have revised the code and are ready for another round of review, run +Or to upload your change without sending a notification, run
-$ hg mail 99999 +$ hg upload 99999-again to upload the latest copy and send mail asking the reviewers to please take another look -(
PTAL
). ++You will probably revise your code in response to the reviewer comments. You might also visit the code review web page and reply to the comments, letting the reviewer know that you've addressed them or explain why you haven't. When you're done replying, click “Publish and Mail comments” to send the line-by-line replies and any other comments.
+The reviewer can comment on the new copy, and the process repeats. The reviewer approves the change by replying with a mail that says @@ -597,11 +606,18 @@ $ hg submit 99999 local repository out of date; must sync before submit
+In addition to the information here, the Go community maintains a CodeReview wiki page. +Feel free to contribute to this page as you learn the review process. +
+Files in the Go repository don't list author names,
both to avoid clutter and to avoid having to keep the lists up to date.
-Instead, your name will appear in the Mercurial change log
+Instead, your name will appear in the Mercurial change log
and in the CONTRIBUTORS
file
and perhaps the AUTHORS
file.
Code that you contribute should use the standard copyright header:
-// Copyright 2013 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.-- cgit v1.2.3