contribute.html 20.6 KB
Newer Older
1 2 3
<!--{
	"Title": "Contribution Guidelines"
}-->
Russ Cox's avatar
Russ Cox committed
4

Russ Cox's avatar
Russ Cox committed
5
<h2 id="Introduction">Introduction</h2>
Russ Cox's avatar
Russ Cox committed
6 7

<p>
8
This document explains how to contribute changes to the Go project.
9
It assumes you have followed the
10
<a href="/doc/install/source">installation instructions</a> and
11
have <a href="code.html">written and tested your code</a>.
12
</p>
13 14

<p>
15
(Note that the <code>gccgo</code> frontend lives elsewhere;
16
see <a href="gccgo_contribute.html">Contributing to gccgo</a>.)
Russ Cox's avatar
Russ Cox committed
17 18
</p>

19 20 21 22
<h2 id="Design">Discuss your design</h2>

<p>
The project welcomes submissions but please let everyone know what
23
you're working on if you want to change or add to the Go repositories.
24 25 26
</p>

<p>
27
Before undertaking to write something new for the Go project,
28 29 30 31 32
please <a href="https://golang.org/issue/new">file an issue</a>
(or claim an <a href="https://golang.org/issues">existing issue</a>).
Significant changes must go through the
<a href="https://golang.org/s/proposal-process">change proposal process</a>
before they can be accepted.
33 34 35
</p>

<p>
36 37 38 39 40
This process 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 and tools.
It also checks that the design is sound before code is written;
the code review tool is not the place for high-level discussions.
41 42
</p>

43 44 45 46 47 48 49 50
<p>
When planning work, please note that the Go project follows a
<a href="https://golang.org/wiki/Go-Release-Cycle">six-month
development cycle</a>. The latter half of each cycle is a three-month
feature freeze during which only bug fixes and doc updates are accepted.
New work cannot be submitted during a feature freeze.
</p>

51
<h2 id="Testing">Testing redux</h2>
Russ Cox's avatar
Russ Cox committed
52 53

<p>
54 55 56
You've <a href="code.html">written and tested your code</a>, but
before sending code out for review, run all the tests for the whole
tree to make sure the changes don't break other packages or programs:
Russ Cox's avatar
Russ Cox committed
57 58 59
</p>

<pre>
60 61
$ cd go/src
$ ./all.bash
Russ Cox's avatar
Russ Cox committed
62 63
</pre>

64 65 66 67
<p>
(To build under Windows use <code>all.bat</code>.)
</p>

Russ Cox's avatar
Russ Cox committed
68
<p>
69 70
After running for a while, the command should print
"<code>ALL</code> <code>TESTS</code> <code>PASSED</code>".
Russ Cox's avatar
Russ Cox committed
71 72
</p>

Russ Cox's avatar
Russ Cox committed
73
<h2 id="Code_review">Code review</h2>
Russ Cox's avatar
Russ Cox committed
74 75

<p>
76
Changes to Go must be reviewed before they are accepted,
Russ Cox's avatar
Russ Cox committed
77
no matter who makes the change.
78
A custom git command called <code>git-codereview</code>,
79 80 81
discussed below, helps manage the code review process through a Google-hosted
<a href="https://go-review.googlesource.com/">instance</a> of the code review
system called <a href="https://code.google.com/p/gerrit/">Gerrit</a>.
Russ Cox's avatar
Russ Cox committed
82
</p>
83

84
<h3 id="auth">Set up authentication for code review</h3>
85

86
<p>
87 88 89 90 91 92
Gerrit uses Google Accounts for authentication. If you don't have
a Google Account, you can create an account which
<a href="https://www.google.com/accounts/NewAccount">includes
a new Gmail email account</a> or create an account associated
<a href="https://accounts.google.com/SignUpWithoutGmail">with your existing
email address</a>.
93 94 95
</p>

<p>
96 97 98
The email address associated with the Google Account you use will be recorded in
the <a href="https://go.googlesource.com/go/+log/">change log</a>
and in the <a href="/CONTRIBUTORS">contributors file</a>.
Russ Cox's avatar
Russ Cox committed
99 100 101
</p>

<p>
102 103 104
To set up your account in Gerrit, visit
<a href="https://go.googlesource.com">go.googlesource.com</a>
and click on "Generate Password" in the page's top right menu bar.
105 106
</p>

107
<p>
108
You will be redirected to accounts.google.com to sign in.
109
</p>
Russ Cox's avatar
Russ Cox committed
110

111
<p>
112 113
Once signed in, you are returned back to go.googlesource.com to "Configure Git".
Follow the instructions on the page.
114 115 116
(If you are on a Windows computer, you should instead follow the instructions
in the yellow box to run the command.)
</p>
Russ Cox's avatar
Russ Cox committed
117

118 119 120 121 122
<p>
Your secret authentication token is now in a <code>.gitcookie</code> file
and Git is configured to use this file.
</p>

123
<h3 id="gerrit">Register with Gerrit</h3>
124

125
<p>
126 127 128 129 130 131
Now that you have your authentication token,
you need to register your account with Gerrit.
To do this, visit
<a href="https://go-review.googlesource.com/login/">
go-review.googlesource.com/login/</a>. You will immediately be redirected
to Google Accounts. Sign in using the same Google Account you used above.
132 133 134
That is all that is required.
</p>

135
<h3 id="cla">Contributor License Agreement</h3>
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169

<p>Gerrit serves as the gatekeeper and uses your e-mail address as the key.
To send your first change to the Go project from a given address,
you must have completed one of the contributor license agreements:
<ul>
<li>
If you are the copyright holder, you will need to agree to the
<a href="https://developers.google.com/open-source/cla/individual">individual
contributor license agreement</a>, which can be completed online.
</li>
<li>
If your organization is the copyright holder, the organization
will need to agree to the
<a href="https://developers.google.com/open-source/cla/corporate">corporate
contributor license agreement</a>.
(If the copyright holder for your code has already completed the
agreement in connection with another Google open source project,
it does not need to be completed again.)
</li>
</ul>

<p>
You can use the links above to create and sign the contributor license agreement
or you can show your current agreements and create new ones through the Gerrit
interface.  <a href="https://go-review.googlesource.com/login/">Log into Gerrit</a>,
click your name in the upper-right, choose "Settings", then select "Agreements"
from the topics on the left. If you do not have a signed agreement listed here,
you can create one by clicking "New Contributor Agreement" and following the steps.
</p>

<p>
This rigmarole only needs to be done for your first submission for each email address.
</p>

170 171 172 173 174 175 176 177
<p>
If the copyright holder for the code you are submitting changes—for example,
if you start contributing code on behalf of a new company—please send email
to let us know, so that we can make sure an appropriate agreement is completed
and update the <code>AUTHORS</code> file.
</p>

<h3 id="git-codereview">Install the git-codereview command</h3>
178 179

<p>
180
Now install the <code>git-codereview</code> command by running,
181 182 183
</p>

<pre>
184
$ go get -u golang.org/x/review/git-codereview
Russ Cox's avatar
Russ Cox committed
185 186
</pre>

187
<p>
188
Make sure <code>git-codereview</code> is installed in your shell path, so that the
189
<code>git</code> command can find it. Check that
Russ Cox's avatar
Russ Cox committed
190 191
</p>

192
<pre>
193
$ git codereview help
194
</pre>
195

196
<p>
197
prints help text, not an error.
198 199
</p>

200
<p>
201
Note to Git aficionados: The <code>git-codereview</code> command is not required to
202
upload and manage Gerrit code reviews. For those who prefer plain Git, the text
203 204
below gives the Git equivalent of each git-codereview command. If you do use plain
Git, note that you still need the commit hooks that the git-codereview command
205 206 207
configures; those hooks add a Gerrit <code>Change-Id</code> line to the commit
message and check that all Go source files have been formatted with gofmt. Even
if you intend to use plain Git for daily work, install the hooks in a new Git
208
checkout by running <code>git-codereview</code> <code>hooks</code>.
209 210
</p>

211
<h3 id="git-config">Set up git aliases</h3>
212

213
<p>
214
The <code>git-codereview</code> command can be run directly from the shell
215 216
by typing, for instance,
</p>
217 218

<pre>
219
$ git codereview sync
220 221
</pre>

222
<p>
223
but it is more convenient to set up aliases for <code>git-codereview</code>'s own
224 225
subcommands, so that the above becomes,
</p>
226 227

<pre>
228
$ git sync
229 230
</pre>

231 232
<p>
The <code>git-codereview</code> subcommands have been chosen to be distinct from
233 234
Git's own, so it's safe to do so.
</p>
Russ Cox's avatar
Russ Cox committed
235 236

<p>
237 238 239 240
The aliases are optional, but in the rest of this document we will assume
they are installed.
To install them, copy this text into your Git configuration file
(usually <code>.gitconfig</code> in your home directory):
Russ Cox's avatar
Russ Cox committed
241 242 243
</p>

<pre>
244
[alias]
245 246 247 248 249 250
	change = codereview change
	gofmt = codereview gofmt
	mail = codereview mail
	pending = codereview pending
	submit = codereview submit
	sync = codereview sync
Russ Cox's avatar
Russ Cox committed
251 252
</pre>

253
<h3 id="help">Understanding the git-codereview command</h3>
Russ Cox's avatar
Russ Cox committed
254

255
<p>After installing the <code>git-codereview</code> command, you can run</p>
256 257

<pre>
258
$ git codereview help
259
</pre>
Russ Cox's avatar
Russ Cox committed
260

261 262
<p>
to learn more about its commands.
263
You can also read the <a href="https://godoc.org/golang.org/x/review/git-codereview">command documentation</a>.
Russ Cox's avatar
Russ Cox committed
264 265
</p>

266
<h3 id="master">Switch to the master branch</h3>
267 268 269

<p>
Most Go installations use a release branch, but new changes should
270 271 272 273
only be made based on the master branch.
(They may be applied later to a release branch as part of the release process,
but most contributors won't do this themselves.)
Before making a change, make sure you start on the master branch:
274 275 276
</p>

<pre>
277 278
$ git checkout master
$ git sync
279 280
</pre>

281 282 283 284 285
<p>
(In Git terms, <code>git</code> <code>sync</code> runs
<code>git</code> <code>pull</code> <code>-r</code>.)
</p>

286
<h3 id="change">Make a change</h3>
Russ Cox's avatar
Russ Cox committed
287

288
<p>
Russ Cox's avatar
Russ Cox committed
289
The entire checked-out tree is writable.
290 291 292 293 294 295 296
Once you have edited files, you must tell Git that they have been modified.
You must also tell Git about any files that are added, removed, or renamed files.
These operations are done with the usual Git commands,
<code>git</code> <code>add</code>,
<code>git</code> <code>rm</code>,
and
<code>git</code> <code>mv</code>.
Russ Cox's avatar
Russ Cox committed
297
</p>
298

299 300
<p>
If you wish to checkpoint your work, or are ready to send the code out for review, run</p>
301

Russ Cox's avatar
Russ Cox committed
302
<pre>
303
$ git change <i>&lt;branch&gt;</i>
Russ Cox's avatar
Russ Cox committed
304
</pre>
305

306 307 308 309
<p>
from any directory in your Go repository to commit the changes so far.
The name <i>&lt;branch&gt;</i> is an arbitrary one you choose to identify the
local branch containing your changes.
Russ Cox's avatar
Russ Cox committed
310
</p>
311

312 313 314 315 316 317
<p>
(In Git terms, <code>git</code> <code>change</code> <code>&lt;branch&gt;</code>
runs <code>git</code> <code>checkout</code> <code>-b</code> <code>branch</code>,
then <code>git</code> <code>branch</code> <code>--set-upstream-to</code> <code>origin/master</code>,
then <code>git</code> <code>commit</code>.)
</p>
318

319 320 321 322 323 324
<p>
Git will open a change description file in your editor.
(It uses the editor named by the <code>$EDITOR</code> environment variable,
<code>vi</code> by default.)
The file will look like:
</p>
Russ Cox's avatar
Russ Cox committed
325

326
<pre>
Russ Cox's avatar
Russ Cox committed
327

328 329 330 331 332 333
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch foo
# Changes not staged for commit:
#	modified:   editedfile.go
#
Russ Cox's avatar
Russ Cox committed
334 335 336
</pre>

<p>
337 338
At the beginning of this file is a blank line; replace it
with a thorough description of your change.
339 340
The first line of the change description is conventionally a one-line
summary of the change, prefixed by the primary affected package,
341 342 343 344 345
and is used as the subject for code review mail.
The rest of the
description elaborates and should provide context for the
change and explain what it does.
If there is a helpful reference, mention it here.
Russ Cox's avatar
Russ Cox committed
346 347 348 349
</p>

<p>
After editing, the template might now read:
Russ Cox's avatar
Russ Cox committed
350 351 352
</p>

<pre>
353
math: improved Sin, Cos and Tan precision for very large arguments
Russ Cox's avatar
Russ Cox committed
354

355 356 357
The existing implementation has poor numerical properties for
large arguments, so use the McGillicutty algorithm to improve
accuracy above 1e10.
Russ Cox's avatar
Russ Cox committed
358

359
The algorithm is described at http://wikipedia.org/wiki/McGillicutty_Algorithm
Russ Cox's avatar
Russ Cox committed
360

361
Fixes #159
Russ Cox's avatar
Russ Cox committed
362

363 364 365 366 367 368
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch foo
# Changes not staged for commit:
#	modified:   editedfile.go
#
Russ Cox's avatar
Russ Cox committed
369 370 371
</pre>

<p>
372 373 374 375 376 377 378 379 380
The commented section of the file lists all the modified files in your client.
It is best to keep unrelated changes in different change lists,
so if you see a file listed that should not be included, abort
the command and move that file to a different branch.
</p>

<p>
The special notation "Fixes #159" associates the change with issue 159 in the
<a href="https://golang.org/issue/159">Go issue tracker</a>.
Russ Cox's avatar
Russ Cox committed
381 382
When this change is eventually submitted, the issue
tracker will automatically mark the issue as fixed.
383 384
(There are several such conventions, described in detail in the
<a href="https://help.github.com/articles/closing-issues-via-commit-messages/">GitHub Issue Tracker documentation</a>.)
Russ Cox's avatar
Russ Cox committed
385 386 387
</p>

<p>
388 389 390
Once you have finished writing the commit message,
save the file and exit the editor.
</p>
Russ Cox's avatar
Russ Cox committed
391 392

<p>
393 394
If you wish to do more editing, re-stage your changes using
<code>git</code> <code>add</code>, and then run
Russ Cox's avatar
Russ Cox committed
395 396 397
</p>

<pre>
398
$ git change
Russ Cox's avatar
Russ Cox committed
399 400
</pre>

401 402 403 404 405 406 407 408 409 410 411 412
<p>
to update the change description and incorporate the staged changes.  The
change description contains a <code>Change-Id</code> line near the bottom,
added by a Git commit hook during the initial
<code>git</code> <code>change</code>.
That line is used by Gerrit to match successive uploads of the same change.
Do not edit or delete it.
</p>

<p>
(In Git terms, <code>git</code> <code>change</code> with no branch name
runs <code>git</code> <code>commit</code> <code>--amend</code>.)
413
</p>
414

415
<h3 id="mail">Mail the change for review</h3>
416 417

<p>
418
Once the change is ready, mail it out for review:
419 420 421
</p>

<pre>
422
$ git mail
423 424
</pre>

425 426 427 428
<p>
You can specify a reviewer or CC interested parties
using the <code>-r</code> or <code>-cc</code> options.
Both accept a comma-separated list of email addresses:
429 430 431
</p>

<pre>
432
$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
433 434 435
</pre>

<p>
436 437 438 439
Unless explicitly told otherwise, such as in the discussion leading
up to sending in the change list, it's better not to specify a reviewer.
All changes are automatically CC'ed to the
<a href="https://groups.google.com/group/golang-codereviews">golang-codereviews@googlegroups.com</a>
440 441
mailing list. If this is your first ever change, there may be a moderation
delay before it appears on the mailing list, to prevent spam.
442 443 444
</p>

<p>
445 446 447
(In Git terms, <code>git</code> <code>mail</code> pushes the local committed
changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code>
<code>HEAD:refs/for/master</code>.)
448 449 450
</p>

<p>
451 452
If your change relates to an open issue, please add a comment to the issue
announcing your proposed fix, including a link to your CL.
453 454 455
</p>

<p>
456 457
The code review server assigns your change an issue number and URL,
which <code>git</code> <code>mail</code> will print, something like:
458 459 460
</p>

<pre>
461 462
remote: New Changes:
remote:   https://go-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments
463 464
</pre>

465
<h3 id="review">Reviewing code</h3>
466

467
<p>
468 469 470 471 472 473 474
Running <code>git</code> <code>mail</code> will send an email to you and the
reviewers asking them to visit the issue's URL and make comments on the change.
When done, the reviewer adds comments through the Gerrit user interface
and clicks "Reply" to send comments back.
You will receive a mail notification when this happens.
You must reply through the web interface.
(Unlike with the old Rietveld review system, replying by mail has no effect.)
475 476
</p>

477
<h3 id="revise">Revise and upload</h3>
478

479
<p>
480 481
You must respond to review comments through the web interface.
(Unlike with the old Rietveld review system, responding by mail has no effect.)
482 483 484
</p>

<p>
485 486 487 488 489
When you have revised the code and are ready for another round of review,
stage those changes and use <code>git</code> <code>change</code> to update the
commit.
To send the update change list for another round of review,
run <code>git</code> <code>mail</code> again.
490 491
</p>

Russ Cox's avatar
Russ Cox committed
492
<p>
493 494 495
The reviewer can comment on the new copy, and the process repeats.
The reviewer approves the change by giving it a positive score
(+1 or +2) and replying <code>LGTM</code>: looks good to me.
Russ Cox's avatar
Russ Cox committed
496 497
</p>

498
<p>
499 500 501
You can see a list of your pending changes by running <code>git</code>
<code>pending</code>, and switch between change branches with <code>git</code>
<code>change</code> <code><i>&lt;branch&gt;</i></code>.
502
</p>
Dave Cheney's avatar
Dave Cheney committed
503

504
<h3 id="sync">Synchronize your client</h3>
Dave Cheney's avatar
Dave Cheney committed
505 506

<p>
507 508
While you were working, others might have submitted changes to the repository.
To update your local branch, run
509 510
</p>

Dave Cheney's avatar
Dave Cheney committed
511
<pre>
512
$ git sync
Dave Cheney's avatar
Dave Cheney committed
513 514
</pre>

Russ Cox's avatar
Russ Cox committed
515
<p>
516
(In git terms, <code>git</code> <code>sync</code> runs
517
<code>git</code> <code>pull</code> <code>-r</code>.)
Russ Cox's avatar
Russ Cox committed
518 519
</p>

Dave Cheney's avatar
Dave Cheney committed
520
<p>
521 522 523
If files you were editing have changed, Git does its best to merge the
remote changes into your local changes.
It may leave some files to merge by hand.
Dave Cheney's avatar
Dave Cheney committed
524
</p>
Russ Cox's avatar
Russ Cox committed
525

526 527 528 529 530
<p>
For example, suppose you have edited <code>sin.go</code> but
someone else has committed an independent change.
When you run <code>git</code> <code>sync</code>,
you will get the (scary-looking) output:
Russ Cox's avatar
Russ Cox committed
531 532

<pre>
533 534 535 536
$ git sync
Failed to merge in the changes.
Patch failed at 0023 math: improved Sin, Cos and Tan precision for very large arguments
The copy of the patch that failed is found in:
537
   /home/you/repo/.git/rebase-apply/patch
538 539 540 541

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
Russ Cox's avatar
Russ Cox committed
542 543 544
</pre>

<p>
545
If this happens, run
Russ Cox's avatar
Russ Cox committed
546 547
</p>

548 549 550 551
<pre>
$ git status
</pre>

Russ Cox's avatar
Russ Cox committed
552
<p>
553 554 555
to see which files failed to merge.
The output will look something like this:
</p>
Russ Cox's avatar
Russ Cox committed
556 557

<pre>
558 559
rebase in progress; onto a24c3eb
You are currently rebasing branch 'mcgillicutty' on 'a24c3eb'.
560 561 562
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)
563 564

Unmerged paths:
565 566
  (use "git reset HEAD &lt;file&gt;..." to unstage)
  (use "git add &lt;file&gt;..." to mark resolution)
567

568
	<i>both modified: sin.go</i>
Russ Cox's avatar
Russ Cox committed
569 570 571
</pre>

<p>
572 573 574 575
The only important part in that transcript is the italicized "both modified"
line: Git failed to merge your changes with the conflicting change.
When this happens, Git leaves both sets of edits in the file,
with conflicts marked by <code>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</code> and
Russ Cox's avatar
Russ Cox committed
576
<code>&gt;&gt;&gt;&gt;&gt;&gt;&gt;</code>.
577
It is now your job to edit the file to combine them.
578
Continuing the example, searching for those strings in <code>sin.go</code>
Russ Cox's avatar
Russ Cox committed
579 580 581 582
might turn up:
</p>

<pre>
583 584
	arg = scale(arg)
&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
585
	if arg &lt; 1e9 {
Russ Cox's avatar
Russ Cox committed
586
=======
587
	if arg &lt; 1e10 {
588 589
&gt;&gt;&gt;&gt;&gt;&gt;&gt; mcgillicutty
		largeReduce(arg)
Russ Cox's avatar
Russ Cox committed
590 591 592
</pre>

<p>
593 594 595
Git doesn't show it, but suppose the original text that both edits
started with was 1e8; you changed it to 1e10 and the other change to 1e9,
so the correct answer might now be 1e10.  First, edit the section
Russ Cox's avatar
Russ Cox committed
596 597
to remove the markers and leave the correct code:
</p>
Russ Cox's avatar
Russ Cox committed
598 599

<pre>
600
	arg = scale(arg)
601
	if arg &lt; 1e10 {
602
		largeReduce(arg)
Russ Cox's avatar
Russ Cox committed
603 604
</pre>

Russ Cox's avatar
Russ Cox committed
605
<p>
606
Then tell Git that the conflict is resolved by running
Russ Cox's avatar
Russ Cox committed
607 608
</p>

609
<pre>
610
$ git add sin.go
611 612
</pre>

Russ Cox's avatar
Russ Cox committed
613
<p>
Russ Cox's avatar
Russ Cox committed
614 615
If you had been editing the file, say for debugging, but do not
care to preserve your changes, you can run
616 617 618 619
<code>git</code> <code>reset</code> <code>HEAD</code> <code>sin.go</code>
to abandon your changes.
Then run <code>git</code> <code>rebase</code> <code>--continue</code> to
restore the change commit.
Russ Cox's avatar
Russ Cox committed
620 621
</p>

622
<h3 id="download">Reviewing code by others</h3>
Russ Cox's avatar
Russ Cox committed
623 624

<p>
625 626 627 628
You can import a change proposed by someone else into your local Git repository.
On the Gerrit review page, click the "Download ▼" link in the upper right
corner, copy the "Checkout" command and run it from your local Git repo.
It should look something like this:
Russ Cox's avatar
Russ Cox committed
629 630 631
</p>

<pre>
632
$ git fetch https://go.googlesource.com/review refs/changes/21/1221/1 &amp;&amp; git checkout FETCH_HEAD
Russ Cox's avatar
Russ Cox committed
633 634 635
</pre>

<p>
636
To revert, change back to the branch you were working in.
637
</p>
Dave Cheney's avatar
Dave Cheney committed
638

639
<h3 id="submit">Submit the change after the review</h3>
Dave Cheney's avatar
Dave Cheney committed
640 641

<p>
642 643 644 645
After the code has been <code>LGTM</code>'ed, an approver may
submit it to the master branch using the Gerrit UI.
There is a "Submit" button on the web page for the change
that appears once the change is approved (marked +2).
Russ Cox's avatar
Russ Cox committed
646 647
</p>

Dave Cheney's avatar
Dave Cheney committed
648 649 650 651 652
<p>
This checks the change into the repository.
The change description will include a link to the code review,
and the code review will be updated with a link to the change
in the repository.
653 654 655
Since the method used to integrate the changes is "Cherry Pick",
the commit hashes in the repository will be changed by
the submit operation.
Dave Cheney's avatar
Dave Cheney committed
656 657
</p>

658
<h3 id="more">More information</h3>
659 660

<p>
661
In addition to the information here, the Go community maintains a <a href="https://golang.org/wiki/CodeReview">CodeReview</a> wiki page.
662 663 664
Feel free to contribute to this page as you learn the review process.
</p>

Dave Cheney's avatar
Dave Cheney committed
665
<h2 id="copyright">Copyright</h2>
Russ Cox's avatar
Russ Cox committed
666

667 668
<p>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.
669 670
Instead, your name will appear in the
<a href="https://golang.org/change">change log</a>
671 672
and in the <a href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file
and perhaps the <a href="/AUTHORS"><code>AUTHORS</code></a> file.
Russ Cox's avatar
Russ Cox committed
673 674
</p>

675 676
<p>The <a href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file
defines who the Go contributors&mdash;the people&mdash;are;
677
the <a href="/AUTHORS"><code>AUTHORS</code></a> file defines
678
who &ldquo;The Go Authors&rdquo;&mdash;the copyright holders&mdash;are.
679 680
These files will be periodically updated based on the commit logs.

681 682 683
<p>Code that you contribute should use the standard copyright header:</p>

<pre>
684
// Copyright 2016 The Go Authors. All rights reserved.
685 686 687
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
</pre>
Dave Cheney's avatar
Dave Cheney committed
688 689 690 691 692

<p>
Files in the repository are copyright the year they are added. It is not
necessary to update the copyright year on files that you change.
</p>