Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot checkout change #71

Open
daankennes opened this issue Jun 12, 2024 · 3 comments
Open

Cannot checkout change #71

daankennes opened this issue Jun 12, 2024 · 3 comments

Comments

@daankennes
Copy link

daankennes commented Jun 12, 2024

Hi,

I just tried configuring this plugin. I can see all changes listed, but when I try to check out a change, the username is capitalized while it should be lowercase entirely. Any pointers on why this is happening? My global .gitconfig looks like this:

...
[user]
email = [email protected]
name = daan
...

In the log files I see this:

GET request to "https://xxx.com/gerrit/a/changes/I498b470c964a07d57a2fc1323d3371189d29bf74/detail/"
Tried to run "git-review -d "I25aa723800470aaf42340968774235af454b02e2"", but failed
Stdout: ssh://[email protected]:29418/labonlineApp did not work. Description: [email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Could not connect to gerrit.
Enter your gerrit username:
Stderr:
Error: Command failed: git-review -d "I25aa723800470aaf42340968774235af454b02e2"

I know this probably has nothing to do with the plugin, but I'm hoping you could point me in the right direction.

Thank you in advance!
Daan

@SanderRonde
Copy link
Owner

Gerrit uses SSH to connect to the server and do its checkouts. So it's using your device's username (probably Daan) to connect since that's what SSH defaults to. The Gerrit CLI does not use your git username at all. You'll want to ensure that using ssh {your_gerrit_server_url} connects succesfully (check out the "SSH Keys" setting in your gerrit settings). After that it should work.

Some tips:

  • You can just run git-review -d {change_number} in the terminal by itself to test it out. That's a bit easier to debug than viewing the extension's logs.
  • You can create a custom Host in your .ssh/config to "rewrite" your username (see here)

@daankennes
Copy link
Author

Thank you! However, I'm afraid I still don't understand entirely. If I use the command ssh -vv -p 29418 xxx.com, I am succesfully authenticated. If I then for example do git-review -d 5161, I get the following:

ssh://[email protected]:29418/repo did not work. Description: [email protected]: Permission denied (publickey).

Also, I tried rewriting my username but that is seemingly ignored.

@SanderRonde
Copy link
Owner

How do you normally use Gerrit? Are you able to check out or push patches at all? Maybe good to check out a Gerrit tutorial or getting started guide. I do have some experience setting Gerrit up but this is more of a gerrit-related question than a vscode-gerrit-related question so obviously I'm not as much of an expert :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants