BT

Go Language Now Accepts Patches via GitHub Pull Requests

| by Sergio De Simone Follow 21 Followers on Feb 15, 2018. Estimated reading time: 1 minute |

Google has started mirroring GitHub PRs for Go into Gerrit, Go’s upstream Git server, thus making it easier for developers to contribute to Go development.

Gerrit is the main code management tool for Go development. To make Go code more easily available to developers, though, all changes merged into Gerrit are mirrored to GitHub GoLang repository. The Go team has recently started mirroring GitHub pull requests as well, with the aim of allowing a more typical workflow for contributing to Go development, writes Go Google engineer Andrew Bonventre.

This is made possible by GerritBot, a bot that will import any GitHub PR to Gerrit and post the link to the Gerrit review as a comment to the GitHub PR. All comments added in Gerrit will be synced back to the PR, so the original PR contributor can address them and push more commits to the same PR branch without ever leaving GitHub.

Gerrit is a web-based code review tool built on top of Git. It aims to make code review easier by providing a lightweight framework to show changes in a side-by-side display and by allowing inline comments. This is somewhat similar to what GitHub provides with Pull Requests (PR), albeit with a major underlying philosophical difference. Indeed, Gerrit performs reviews on a per-commit basis while GitHub PRs are based on differences between two branches. This has significant implications in terms of what workflows work more naturally in GitHub or Gerrit. Specifically, Gerrit focus on single-commit review means changes should be broken into small, self-contained commits, while it is usual for a GitHub PR to include several commits.

Additionally, Gerrit fosters a model where commits move through successive revisions, before being actually merged upstream, with the goal of carefully crafting the change history by amending earlier commits, or squashing multiple commits into one, etc. This may not be the most common use of GitHub PRs, especially not when using GitHub Web UI, although you could manually attain similar results when handling PRs using the command line.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
BT