2

I am developing towards a gerrit repo which is used by a big open source community. To merge patches, we can't just push them but they need to be reviewed. Using the git cli, I do that using "git review" after committing the patch locally. I know how to 'git pull' changes and 'git push' patches using IntelliJ but I don't know how to 'git review' patches. Does anybody know if this is supported and how to use it?

M. Buil
  • 529
  • 1
  • 4
  • 22

2 Answers2

6

You can submit the patches to gerrit after you install the plugin from repository.

  1. GoTo File -> settings -> plugins
  2. Search for gerrit from the repository and install it
  3. After installation, restart the IDEA
  4. Then GoTo File -> settings -> version control
  5. Select Gerrit and submit the web-url, Login, Password
  6. Now you can submit the patches to Gerrit.

Since it uses RestAPI, you'll probably need to add HTTP Password (your Git SSH password won't work).

For example, to use gerrit for Openstack projects, you should create an HTTP password at: https://review.openstack.org/#/settings/http-password enter image description here Notice that in PyCharm Gerrit Settings, the Web-URL is not the same as the Git URL: https://review.openstack.org

Noam Manos
  • 15,216
  • 3
  • 86
  • 85
1

git review is not a default git command, it is a third-party tool that executes a series of git commands for you. Thus it is not directly supported.

Since git-review execute a series of git commands (like rebase and push), you could manually do the same using IDEA features. THe steps it does is described on the wiki

Also, there are plugins for Gerrit available. E.g. https://github.com/uwolfer/gerrit-intellij-plugin

Dmitrii Smirnov
  • 7,073
  • 1
  • 19
  • 29