uwolfer / gerrit-intellij-plugin

Gerrit Code Review Tool Integration for the IntelliJ Platform
Apache License 2.0
495 stars 103 forks source link

Could not fetch commit because no remote url matches Gerrit host #374

Closed edunyashin closed 4 years ago

edunyashin commented 4 years ago

I have cloned project from gerrit UI via git ssh. I installed gerrit plugin to IDEA and setup it setting web uri, username and password. I'm able to view a list of reviews but I'm not able to checkout reviews. As work around I can add http connection to .git/config file BUT i need to do it with each of my repository. I'm getting an error below when I click to review or perform any commands to it.

2:40 PM Error
    Could not fetch commit because no remote url matches Gerrit host.
    it repository: '<path to repository on local machine>'.

BTW I'm able to commit to gerrit but nothing more

uwolfer commented 4 years ago

Do the Gerrit Web UI and Git clone URL differ in your case?

edunyashin commented 4 years ago

In my case web-url looks like https://gerrit-test.projects.com and ssh url used to clone is like ssh://egor_dunyashin@company.com@gerrit-test.projects.com:29408

uwolfer commented 4 years ago

That should work, see the relevant code.

One thing which could break: the @ in your username. Could you try to URL encode this (not sure if that works, but please try)?

edunyashin commented 4 years ago

@uwolfer thank you so much. After this I faced error below error fatal: ssh variant 'simple' does not support setting port And now after configuration of ssh.variant as git it works!

pks-1981 commented 4 years ago

@edunyashin I have this problem too. What exactly did you do?

pks-1981 commented 4 years ago

Found a solution: Ctrl + F12 (Terminal) In the terminal git remote get-url --all origin

My response look like: ssh://user@server.com@gerrit.server.com:11111/project

Replace @ to %40

In the terminal git remote set-url origin ssh://user%40server.com@gerrit.server.com:11111/project

pks-1981 commented 4 years ago

@uwolfer Maybe add checkbox I have @ in the user name? And the @ handling in the username?