Unofficial IntelliJ Platform plugin for the Gerrit Code Review tool. It supports any product based on the IntelliJ platform:
Compiled with Java 11
Only Gerrit 2.6 or newer is supported (missing / incomplete REST API in older versions).
Restart your IDE.
If you like this plugin, you can support it:
By default, you will only see changes to Git repositories that are configured in the current project of your IntelliJ IDE.
In Gerrit 2.8, fetch information was pulled out of default functionality into a plugin.
You need to install the plugin download-commands
. When you run the Gerrit update procedure, it asks you to install
this plugin (but it isn't selected by default). Just run the update script again if you have not installed it yet.
When installing Gerrit 2.8 (or newer) from scratch (rather than using the update script) the following command will install the
download-commands
plugin (for a new installation or an existing Gerrit instance):
$ java -jar gerrit.war init -d {gerrit-instance} --install-plugin=download-commands
There are two workarounds for this issue:
Open plugin settings and enable the option "List all Gerrit changes (instead of changes from currently open project only)".
Checking out directly with the Gerrit plugin does not work for some authentication methods. If you get an authentication error or checking out does not properly finish, you can try to:
You can find background information about this issue in a Gerrit mailing list topic.
Diff viewing is based on Git operations (i.e. it fetches the commit from the Gerrit remote). When loading the file list takes a lot of time, you can run a local "git gc" and ask your Gerrit administrator to do run a "gerrit gc".
It's a bit of manual work to do: Settings -> HTTP Credentials -> Obtain password
Then search for the line in the text area starting with *-review.googlesource.com
(e.g. gerrit-review.googlesource.com
) and extract username and password:
gerrit-review.googlesource.com,FALSE,/,TRUE,12345678,o,git-username.gmail.com=password-until-end-of-line
The plugin is integrated into the IntelliJ IDE with a tool window.
See package com.urswolfer.intellij.plugin.gerrit.ui
.
Most of the communication between the plugin and a Gerrit instance is based on the Gerrit REST API.
The REST specific part is available as standalone implementation.
See package com.urswolfer.intellij.plugin.gerrit.rest
.
Some actions like comparing and listing files are based on Git operations.
IntelliJ Git4Idea is used for these operations.
See package com.urswolfer.intellij.plugin.gerrit.git
.
It's very easy to set it up as an IntelliJ project.
Gradle
, Plugin DevKit
and UI Designer
in IntelliJ.git clone https://github.com/uwolfer/gerrit-intellij-plugin
(probably switch to intellij{version}
branch, but keep in mind that pull-requests should be against the default branch ("intellij13" and older are not supported anymore))build.gradle
in gerrit-intellij-plugin
folder and press "OK")Once build.gradle
gets updated, you need to "Refresh all Gradle projects" in the Gradle panel.
Check the CONTRIBUTING.md
file.
Thanks to JetBrains for providing a free licence for developing this project.
If you like this work, you can support it with this donation link. If you don't like Paypal (Paypal takes 2.9% plus $0.30 per transaction fee from your donation), please contact me. Please only use the link from github.com/uwolfer/gerrit-intellij-plugin to verify that it is correct.
Copyright 2013 - 2018 Urs Wolfer
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.