|
|
@@ -35,10 +35,16 @@ Below are the steps to send a change using Gerrit.
|
|
|
|
|
|
**Step 1:** Clone the Go source code:
|
|
|
```
|
|
|
-git clone https://go.googlesource.com/protobuf
|
|
|
+$ git clone https://go.googlesource.com/protobuf
|
|
|
```
|
|
|
|
|
|
-**Step 2:** Prepare changes in a new branch, created from the `master` branch.
|
|
|
+**Step 2:** Setup a Git hook:
|
|
|
+Setup a hook to run the tests prior to submitting changes to Gerrit:
|
|
|
+```
|
|
|
+$ (cd protobuf/.git/hooks && echo -e '#!/bin/bash\n./test.bash' > pre-push && chmod a+x pre-push)
|
|
|
+```
|
|
|
+
|
|
|
+**Step 3:** Prepare changes in a new branch, created from the `master` branch.
|
|
|
To commit the changes, use `git codereview change`;
|
|
|
that will create or amend a single commit in the branch.
|
|
|
|
|
|
@@ -53,12 +59,12 @@ $ git codereview change # amend the existing commit with new changes
|
|
|
$ [etc.]
|
|
|
```
|
|
|
|
|
|
-**Step 3:** Send the changes for review to Gerrit using `git codereview mail`.
|
|
|
+**Step 4:** Send the changes for review to Gerrit using `git codereview mail`.
|
|
|
```
|
|
|
$ git codereview mail # send changes to Gerrit
|
|
|
```
|
|
|
|
|
|
-**Step 4:** After a review, there may be changes that are required.
|
|
|
+**Step 5:** After a review, there may be changes that are required.
|
|
|
Do so by applying changes to the same commit and mail them to Gerrit again:
|
|
|
```
|
|
|
$ [edit files...]
|
|
|
@@ -67,6 +73,9 @@ $ git codereview change # update same commit
|
|
|
$ git codereview mail # send to Gerrit again
|
|
|
```
|
|
|
|
|
|
+When calling `git codereview mail`, it will call `git push` under the hood,
|
|
|
+which will trigger the test hook that was setup in step 2.
|
|
|
+
|
|
|
The [Contribution Guidelines](https://golang.org/doc/contribute.html) for the
|
|
|
Go project provides additional details that are also relevant to
|
|
|
contributing to the Go `protobuf` project.
|