Commit 4482c7b1 authored by Russ Cox's avatar Russ Cox

[release-branch.go1.4] doc: copy contribute.html and install-source.html from master

This incorporates the various git-related updates that have
happened since the Go 1.4 release. Since Go 1.4.1 will be issued
from Git, it is appropriate to replace the Mercurial instructions
with Git instructions.

Change-Id: Idec041002c7f325c4eee6f25c50423b088b11468
Reviewed-on: https://go-review.googlesource.com/2788Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
parent 7cb53b8c
...@@ -6,19 +6,10 @@ ...@@ -6,19 +6,10 @@
<p> <p>
This document explains how to contribute changes to the Go project. This document explains how to contribute changes to the Go project.
It assumes you have installed Go from source: It assumes you have followed the
<p>
<pre>
$ git clone https://go.googlesource.com/go
$ cd go/src
$ ./all.bash
</pre>
<!--
TODO(adg): delete the above, restore the below after we have updated install-source.html
<a href="/doc/install/source">installation instructions</a> and <a href="/doc/install/source">installation instructions</a> and
have <a href="code.html">written and tested your code</a>. have <a href="code.html">written and tested your code</a>.
--> </p>
<p> <p>
(Note that the <code>gccgo</code> frontend lives elsewhere; (Note that the <code>gccgo</code> frontend lives elsewhere;
...@@ -77,7 +68,7 @@ Changes to Go must be reviewed before they are submitted, ...@@ -77,7 +68,7 @@ Changes to Go must be reviewed before they are submitted,
no matter who makes the change. no matter who makes the change.
(In exceptional cases, such as fixing a build, the review can (In exceptional cases, such as fixing a build, the review can
follow shortly after submitting.) follow shortly after submitting.)
A custom git command called <code>git-review</code>, A custom git command called <code>git-codereview</code>,
discussed below, helps manage the code review process through a Google-hosted 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 <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>. system called <a href="https://code.google.com/p/gerrit/">Gerrit</a>.
...@@ -132,23 +123,23 @@ and log in using the same Google Account you used above. ...@@ -132,23 +123,23 @@ and log in using the same Google Account you used above.
That is all that is required. That is all that is required.
</p> </p>
<h3>Install the git-review command</h3> <h3>Install the git-codereview command</h3>
<p> <p>
Now install the <code>git-review</code> command by running, Now install the <code>git-codereview</code> command by running,
</p> </p>
<pre> <pre>
go get -u golang.org/x/review/git-review go get -u golang.org/x/review/git-codereview
</pre> </pre>
<p> <p>
Make sure <code>git-review</code> is installed in your shell path, so that the Make sure <code>git-codereview</code> is installed in your shell path, so that the
<code>git</code> command can find it. Check that <code>git</code> command can find it. Check that
</p> </p>
<pre> <pre>
$ git review help $ git codereview help
</pre> </pre>
<p> <p>
...@@ -156,29 +147,29 @@ prints help text, not an error. ...@@ -156,29 +147,29 @@ prints help text, not an error.
</p> </p>
<p> <p>
Note to Git aficionados: The <code>git-review</code> command is not required to Note to Git aficionados: The <code>git-codereview</code> command is not required to
upload and manage Gerrit code reviews. For those who prefer plain Git, the text 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 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-review command Git, note that you still need the commit hooks that the git-codereview command
configures; those hooks add a Gerrit <code>Change-Id</code> line to the commit 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 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 if you intend to use plain Git for daily work, install the hooks in a new Git
checkout by running <code>git-review</code> <code>hooks</code>). checkout by running <code>git-codereview</code> <code>hooks</code>.
</p> </p>
<h3>Set up git aliases</h3> <h3>Set up git aliases</h3>
<p> <p>
The <code>git-review</code> command can be run directly from the shell The <code>git-codereview</code> command can be run directly from the shell
by typing, for instance, by typing, for instance,
</p> </p>
<pre> <pre>
$ git review sync $ git codereview sync
</pre> </pre>
<p> <p>
but it is more convenient to set up aliases for <code>git-review</code>'s own but it is more convenient to set up aliases for <code>git-codereview</code>'s own
subcommands, so that the above becomes, subcommands, so that the above becomes,
</p> </p>
...@@ -186,8 +177,8 @@ subcommands, so that the above becomes, ...@@ -186,8 +177,8 @@ subcommands, so that the above becomes,
$ git sync $ git sync
</pre> </pre>
</p> <p>
The <code>git-review</code> subcommands have been chosen to be distinct from The <code>git-codereview</code> subcommands have been chosen to be distinct from
Git's own, so it's safe to do so. Git's own, so it's safe to do so.
</p> </p>
...@@ -200,24 +191,25 @@ To install them, copy this text into your Git configuration file ...@@ -200,24 +191,25 @@ To install them, copy this text into your Git configuration file
<pre> <pre>
[alias] [alias]
change = review change change = codereview change
gofmt = review gofmt gofmt = codereview gofmt
mail = review mail mail = codereview mail
pending = review pending pending = codereview pending
sync = review sync submit = codereview submit
sync = codereview sync
</pre> </pre>
<h3>Understanding the git-review command</h3> <h3>Understanding the git-codereview command</h3>
<p>After installing the <code>git-review</code> command, you can run</p> <p>After installing the <code>git-codereview</code> command, you can run</p>
<pre> <pre>
$ git review help $ git codereview help
</pre> </pre>
<p> <p>
to learn more about its commands. to learn more about its commands.
You can also read the <a href="https://godoc.org/golang.org/x/review/git-review">command documentation</a>. You can also read the <a href="https://godoc.org/golang.org/x/review/git-codereview">command documentation</a>.
</p> </p>
<h3>Switch to the master branch</h3> <h3>Switch to the master branch</h3>
...@@ -469,7 +461,7 @@ $ git sync ...@@ -469,7 +461,7 @@ $ git sync
</pre> </pre>
<p> <p>
(In git terms, git sync runs (In git terms, <code>git</code> <code>sync</code> runs
<code>git</code> <code>pull</code> <code>-r</code>.) <code>git</code> <code>pull</code> <code>-r</code>.)
</p> </p>
...@@ -660,7 +652,7 @@ This rigmarole needs to be done only for your first submission. ...@@ -660,7 +652,7 @@ This rigmarole needs to be done only for your first submission.
<p>Code that you contribute should use the standard copyright header:</p> <p>Code that you contribute should use the standard copyright header:</p>
<pre> <pre>
// 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 // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
</pre> </pre>
......
...@@ -81,38 +81,21 @@ The full set of supported combinations is listed in the discussion of ...@@ -81,38 +81,21 @@ The full set of supported combinations is listed in the discussion of
<p> <p>
The Go tool chain is written in C. To build it, you need a C compiler installed. The Go tool chain is written in C. To build it, you need a C compiler installed.
Please refer to the <a href="//golang.org/wiki/InstallFromSource#Install_C_tools">InstallFromSource</a> Please refer to the <a href="//golang.org/wiki/InstallFromSource#install-c-tools">InstallFromSource</a>
page on the Go community Wiki for operating system specific instructions. page on the Go community Wiki for operating system specific instructions.
</p> </p>
<h2 id="mercurial">Install Mercurial, if needed</h2> <h2 id="git">Install Git, if needed</h2>
<p> <p>
To perform the next step you must have Mercurial installed. (Check that you To perform the next step you must have Git installed. (Check that you
have an <code>hg</code> command.) have a <code>git</code> command before proceeding.)
</p> </p>
<p> <p>
If you do not have a working Mercurial installation, If you do not have a working Git installation,
follow the instructions on the follow the instructions on the
<a href="http://mercurial.selenic.com/downloads">Mercurial downloads</a> page. <a href="http://git-scm.com/downloads">Git downloads</a> page.
</p>
<p>
Mercurial versions 1.7.x and up require the configuration of
<a href="http://mercurial.selenic.com/wiki/CACertificates">Certification Authorities</a>
(CAs). Error messages of the form:
</p>
<pre>
warning: code.google.com certificate with fingerprint b1:af: ... bc not verified (check hostfingerprints or web.cacerts config setting)
</pre>
<p>
when using Mercurial indicate that the CAs are missing.
Check your Mercurial version (<code>hg --version</code>) and
<a href="http://mercurial.selenic.com/wiki/CACertificates#Configuration_of_HTTPS_certificate_authorities">configure the CAs</a>
if necessary.
</p> </p>
...@@ -121,22 +104,24 @@ if necessary. ...@@ -121,22 +104,24 @@ if necessary.
<p>Go will install to a directory named <code>go</code>. <p>Go will install to a directory named <code>go</code>.
Change to the directory that will be its parent Change to the directory that will be its parent
and make sure the <code>go</code> directory does not exist. and make sure the <code>go</code> directory does not exist.
Then check out the repository:</p> Then clone the repository and check out the latest release tag:</p>
<pre> <pre>
$ hg clone -u release https://code.google.com/p/go $ git clone https://go.googlesource.com/go
$ cd go
$ git checkout go1.4
</pre> </pre>
<h2 id="head">(Optional) Switch to the default branch</h2> <h2 id="head">(Optional) Switch to the master branch</h2>
<p>If you intend to modify the go source code, and <p>If you intend to modify the go source code, and
<a href="/doc/contribute.html">contribute your changes</a> <a href="/doc/contribute.html">contribute your changes</a>
to the project, then move your repository 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.</p> Otherwise, skip this step.</p>
<pre> <pre>
$ hg update default $ git checkout master
</pre> </pre>
<h2 id="install">Install Go</h2> <h2 id="install">Install Go</h2>
...@@ -259,7 +244,7 @@ $ go get golang.org/x/tools/cmd/godoc ...@@ -259,7 +244,7 @@ $ go get golang.org/x/tools/cmd/godoc
<p> <p>
To install these tools, the <code>go</code> <code>get</code> command requires To install these tools, the <code>go</code> <code>get</code> command requires
that <a href="#mercurial">Mercurial</a> be installed locally. that <a href="#git">Git</a> be installed locally.
</p> </p>
<p> <p>
...@@ -292,22 +277,18 @@ that receives a message summarizing each checkin to the Go repository. ...@@ -292,22 +277,18 @@ that receives a message summarizing each checkin to the Go repository.
</p> </p>
<p> <p>
Bugs can be reported using the <a href="//code.google.com/p/go/issues/list">Go issue tracker</a>. Bugs can be reported using the <a href="//golang.org/issue/new">Go issue tracker</a>.
</p> </p>
<h2 id="releases">Keeping up with releases</h2> <h2 id="releases">Keeping up with releases</h2>
<p> <p>
The Go project maintains a stable tag in its Mercurial repository: New releases are announced on the
<code>release</code>.
</p>
<p>
The <code>release</code> tag refers to the current stable release of Go.
Most Go users should use this version. New releases are announced on the
<a href="//groups.google.com/group/golang-announce">golang-announce</a> <a href="//groups.google.com/group/golang-announce">golang-announce</a>
mailing list. mailing list.
Each announcement mentions the latest release tag, for instance,
<code>go1.4</code>.
</p> </p>
<p> <p>
...@@ -316,11 +297,13 @@ To update an existing tree to the latest release, you can run: ...@@ -316,11 +297,13 @@ To update an existing tree to the latest release, you can run:
<pre> <pre>
$ cd go/src $ cd go/src
$ hg pull $ git fetch
$ hg update release $ git checkout <i>&lt;tag&gt;</i>
$ ./all.bash $ ./all.bash
</pre> </pre>
Where <code>&lt;tag&gt;</code> is the version string of the release.
<h2 id="environment">Optional environment variables</h2> <h2 id="environment">Optional environment variables</h2>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment