From 4482c7b1a1ad3a7dd31f6b6cd26fcfd2758743d9 Mon Sep 17 00:00:00 2001
From: Russ Cox
This document explains how to contribute changes to the Go project.
-It assumes you have installed Go from source:
-
-
-
-$ git clone https://go.googlesource.com/go
-$ cd go/src
-$ ./all.bash
-
-
+
(Note that the gccgo
frontend lives elsewhere;
@@ -77,7 +68,7 @@ Changes to Go must be reviewed before they are submitted,
no matter who makes the change.
(In exceptional cases, such as fixing a build, the review can
follow shortly after submitting.)
-A custom git command called git-review
,
+A custom git command called git-codereview
,
discussed below, helps manage the code review process through a Google-hosted
instance of the code review
system called Gerrit.
@@ -132,53 +123,53 @@ and log in using the same Google Account you used above.
That is all that is required.
-Now install the git-review
command by running,
+Now install the git-codereview
command by running,
-go get -u golang.org/x/review/git-review +go get -u golang.org/x/review/git-codereview
-Make sure git-review
is installed in your shell path, so that the
+Make sure git-codereview
is installed in your shell path, so that the
git
command can find it. Check that
-$ git review help +$ git codereview help- +
prints help text, not an error.
-Note to Git aficionados: The git-review
command is not required to
+Note to Git aficionados: The git-codereview
command is not required to
upload and manage Gerrit code reviews. For those who prefer plain Git, the text
-below gives the Git equivalent of each git-review command. If you do use plain
-Git, note that you still need the commit hooks that the git-review command
+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
configures; those hooks add a Gerrit Change-Id
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
-checkout by running git-review
hooks
).
+checkout by running git-codereview
hooks
.
-The git-review
command can be run directly from the shell
+The git-codereview
command can be run directly from the shell
by typing, for instance,
-$ git review sync +$ git codereview sync
-but it is more convenient to set up aliases for git-review
's own
+but it is more convenient to set up aliases for git-codereview
's own
subcommands, so that the above becomes,
git-review
subcommands have been chosen to be distinct from
+
+The git-codereview
subcommands have been chosen to be distinct from
Git's own, so it's safe to do so.
[alias] - change = review change - gofmt = review gofmt - mail = review mail - pending = review pending - sync = review sync + change = codereview change + gofmt = codereview gofmt + mail = codereview mail + pending = codereview pending + submit = codereview submit + sync = codereview sync-
After installing the git-review
command, you can run
After installing the git-codereview
command, you can run
-$ git review help +$ git codereview help
to learn more about its commands. -You can also read the command documentation. +You can also read the command documentation.
(In Git terms, git
change
with no branch name
runs git
commit
--amend
.)
-
-(In git terms, git sync runs
+(In git terms, git
sync
runs
git
pull
-r
.)
Code that you contribute should use the standard copyright header:
-// Copyright 2014 The Go Authors. All rights reserved. +// Copyright 2015 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.diff --git a/doc/install-source.html b/doc/install-source.html index f53deb404c..15cb624df2 100644 --- a/doc/install-source.html +++ b/doc/install-source.html @@ -81,38 +81,21 @@ The full set of supported combinations is listed in the discussion of
The Go tool chain is written in C. To build it, you need a C compiler installed. -Please refer to the InstallFromSource +Please refer to the InstallFromSource page on the Go community Wiki for operating system specific instructions.
-
-To perform the next step you must have Mercurial installed. (Check that you
-have an hg
command.)
+To perform the next step you must have Git installed. (Check that you
+have a git
command before proceeding.)
-If you do not have a working Mercurial installation, +If you do not have a working Git installation, follow the instructions on the -Mercurial downloads page. -
- --Mercurial versions 1.7.x and up require the configuration of -Certification Authorities -(CAs). Error messages of the form: -
- --warning: code.google.com certificate with fingerprint b1:af: ... bc not verified (check hostfingerprints or web.cacerts config setting) -- -
-when using Mercurial indicate that the CAs are missing.
-Check your Mercurial version (hg --version
) and
-configure the CAs
-if necessary.
+Git downloads page.
Go will install to a directory named go
.
Change to the directory that will be its parent
and make sure the go
directory does not exist.
-Then check out the repository:
-$ hg clone -u release https://code.google.com/p/go +$ git clone https://go.googlesource.com/go +$ cd go +$ git checkout go1.4-
If you intend to modify the go source code, and contribute your changes to the project, then move your repository -off the release branch, and onto the default (development) branch. +off the release branch, and onto the master (development) branch. Otherwise, skip this step.
-$ hg update default +$ git checkout master
To install these tools, the go
get
command requires
-that Mercurial be installed locally.
+that Git be installed locally.
@@ -292,22 +277,18 @@ that receives a message summarizing each checkin to the Go repository.
-Bugs can be reported using the Go issue tracker. +Bugs can be reported using the Go issue tracker.
-The Go project maintains a stable tag in its Mercurial repository:
-release
.
-
-The release
tag refers to the current stable release of Go.
-Most Go users should use this version. New releases are announced on the
+New releases are announced on the
golang-announce
mailing list.
+Each announcement mentions the latest release tag, for instance,
+go1.4
.
@@ -316,11 +297,13 @@ To update an existing tree to the latest release, you can run:
$ cd go/src -$ hg pull -$ hg update release +$ git fetch +$ git checkout <tag> $ ./all.bash+Where
<tag>
is the version string of the release.
+