Skip to content

Commit f8961c3

Browse files
committed
GerritBot.md: add summary bullets and image for editing commit message text in GitHub
The FAQ on "How does GerritBot determine the final commit message" is a link destination from various documentation and automatic messages from GerritBot. Add some summary bullets at the start along with a simple image showing where to edit in the GitHub PR. The FAQ on "I left a reply to a comment in Gerrit but no one but me can see it" is similarly a link destination. Add a reminder there that the user should be logged in to Gerrit, especially if they don't see the "Reply" button. Change-Id: I17bab63acddbbe328d08ababfebaceb37ea8e0f3 Reviewed-on: https://go-review.googlesource.com/c/wiki/+/691076 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
1 parent 15cebd9 commit f8961c3

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

GerritBot.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,42 @@ This is a limitation of the infrastructure that runs our Gerrit instances and is
3434

3535
Replies to comments on code in Gerrit are first saved as drafts and need to be published via the “Reply” button. This is to prevent multiple emails per review “session” and is similar to the [pending review workflow](https://help.github.com/articles/reviewing-proposed-changes-in-a-pull-request/) in GitHub. If you see a number next to the “Reply” text in the button, this means you have pending drafts to publish.
3636

37+
If you do not see a large blue “Reply” button near the top of the Gerrit web interface,
38+
make sure you are [logged in to Gerrit](https://go-review.googlesource.com/login/),
39+
which requires a Gmail or other Google account.
40+
3741
### How does GerritBot determine the final commit message?
3842

39-
It uses the title and description of the GitHub PR to construct the commit message for the Gerrit change. You can edit this using the GitHub web interface (not Gerrit or git). The PR description is in the first text area in the "Conversation" tab of the GitHub PR. It is editable via "Edit" option on the "..." menu.
43+
The key points to remember:
44+
* The GitHub PR title and PR description (the first PR comment) are periodically imported into Gerrit
45+
in their plaintext form as the Gerrit commit message.
46+
* **To update the Gerrit commit message**, you must therefore **edit the PR title and PR description**
47+
using the **GitHub web interface**.
48+
* You **cannot update the Gerrit commit message just by pushing another commit** to the PR with
49+
an updated commit message. (Pushing another commit does not automatically update the GitHub PR title
50+
or PR description, and hence the updated text won't be imported into Gerrit).
51+
52+
**Updating the Gerrit commit messsage via the GitHub PR:**
53+
54+
![Screenshot of the GitHub PR web interface highlighting
55+
the "Edit" button in top-right (for editing the Gerrit commit message title) and
56+
the "Edit" menu option on the first comment (for editing the Gerrit commit message
57+
body).](images/gerritbot-how-to-edit-in-github.png)
58+
59+
In more detail, GerritBot uses the latest PR title and PR description from the GitHub PR to construct the
60+
commit message for the Gerrit change. This text is editable via the GitHub web interface (not Gerrit or git):
61+
* The **PR title** is editable via the "Edit" button in the top-right of the PR page.
62+
This is used for the first line of the commit message in Gerrit.
63+
* The **PR description** is in the first text area under the "Conversation" tab of the GitHub PR.
64+
It is editable via "Edit" option on the "..." menu. This text is used for the remainder of the commit
65+
message body in Gerrit.
66+
67+
Once the PR is edited in GitHub, it can take 10 minutes or so before the Gerrit change is updated.
4068

4169
**Note:** Gerrit imports the **plain** text that is viewable as you edit the message in GitHub, and it does not import the **rendered** text you see in GitHub prior to editing.
4270

4371
One common area of related confusion is around **issue references**. For example, GerritBot or a human reviewer might ask you to [avoid URLs for issue references](https://go.dev/doc/contribute#ref_issues). In Gerrit, you might see the full URL for an issue, but in the GitHub web interface, you might only see an issue reference like `#12345` and it might be unclear where the URL is coming from. This can be due to confusion between the rendered view in GitHub vs. the underlying raw/plain text. If the GitHub web interface shows something like `Fixes https://github.com/golang/go/issues/12345` while you are **editing the text in GitHub**, change it to something like `Fixes #12345` or `Fixes golang/go#12345` instead. See the [Contribution Guide](https://go.dev/doc/contribute#ref_issues) for more on issue references.
4472

45-
Once the PR is edited in GitHub, it can take 10 minutes or so before the Gerrit change is updated.
46-
4773
### What is a CL? What is a Gerrit change?
4874

4975
CL is short for "change list", which is essentially a patch proposed to be introduced into a repository. The Go project uses Gerrit to carefully review each CL. An example CL is https://go.dev/cl/508475.
130 KB
Loading

0 commit comments

Comments
 (0)