summaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorAlexander Neumann <alexander@bumpern.de>2015-06-24 19:20:27 +0200
committerAlexander Neumann <alexander@bumpern.de>2015-06-24 20:29:58 +0200
commit069e724d916e228a99f6fe257140699f6799d5ff (patch)
tree968ee03c0295d62223c0aee917e7f2e06f72a7d7 /CONTRIBUTING.md
parent9e9177ab73139f6292b4f3b5724c6bb7e230d6f7 (diff)
Document development environment
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md41
1 files changed, 40 insertions, 1 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 48b8e5600..e31b5e135 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -24,6 +24,42 @@ If you are unsure what to do, please have a look at the issues, especially
those tagged
[minor complexity](https://github.com/restic/restic/labels/minor%20complexity).
+
+Development Environment
+=======================
+
+For development, it is recommended to check out the restic repository within a
+`GOPATH`, an introductory text is
+["How to Write Go Code"](https://golang.org/doc/code.html). It is recommended
+to have a working directory, we're using `~/work/restic` in the following. This
+directory mainly contains the directory `src`, where the source code is stored.
+
+First, create the necessary directory structure and clone the restic repository
+to the correct location:
+
+ $ mkdir --parents ~/work/restic/src/github.com/restic
+ $ cd ~/work/restic/src/github.com/restic
+ $ git clone https://github.com/restic/restic
+ $ cd restic
+
+Now we're in the main directory of the restic repository. The last step is to
+set the environment variable `$GOPATH` to the correct value:
+
+ $ export GOPATH=~/work/restic:~/work/restic/src/github.com/restic/restic/Godeps/_workspace
+
+The following commands can be used to run all the tests:
+
+ $ go test ./...
+ ok github.com/restic/restic 8.174s
+ [...]
+
+The restic binary can be built from the directory `cmd/restic` this way:
+
+ $ cd cmd/restic
+ $ go build
+ $ ./restic version
+ restic compiled manually on go1.4.2
+
Providing Patches
=================
@@ -34,7 +70,10 @@ down to the following steps:
1. First we would kindly ask you to fork our project on GitHub if you haven't
done so already.
- 2. Clone the repository locally and create a new branch.
+ 2. Clone the repository locally and create a new branch. If you are working on
+ the code itself, please set up the development environment as described in
+ the previous section and instead of cloning add your fork on GitHub as a
+ remote to the clone of the restic repository.
3. Then commit your changes as fine grained as possible, as smaller patches,
that handle one and only one issue are easier to discuss and merge.
4. Push the new branch with your changes to your fork of the repository.