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

gerrit plugin does not work for WSL2 projects #408

Open
eekboom opened this issue May 20, 2021 · 4 comments
Open

gerrit plugin does not work for WSL2 projects #408

eekboom opened this issue May 20, 2021 · 4 comments
Labels

Comments

@eekboom
Copy link
Contributor

eekboom commented May 20, 2021

IDEA is clever enough to open projects correctly even if they are in the WSL2 file system (using the \wsl$.., path prefix).
For git operations it then directly uses the git client installed in the wsl subsystem.

However when I try to check out a gerrit change using the plugin, then the project path is wrong and the operations fails with "Invalid reference: FETCH_HEAD". From IDEAs git Console log:

20:55:27.587: [acme] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false fetch //wsl$/Ubuntu-20.04/home/stephen/dev/work/acme 92394348d0b671a7e2a49cb8546288e11eae6734 --progress --prune
fatal: '//wsl$/Ubuntu-20.04/home/stephen/dev/work/acme' does not appear to be a git repository

IDEA executes that command directly in wsl2/Ubuntu, so paths there should not contain the "//wsl$/Ubuntu-20.04" prefix.
When I try this on the wsl2 command line, it works fine:

git -c credential.helper= -c core.quotepath=false -c log.showSignature=false fetch /home/stephen/dev/work/acme 92394348d0b671a7e2a49cb8546288e11eae6734 --progress --prune
@uwolfer
Copy link
Owner

uwolfer commented May 30, 2021

I do not have such a setup available to test. If you do have any suspicions what could cause the issues here, feedback would be very welcome.

@eekboom
Copy link
Contributor Author

eekboom commented May 30, 2021

I assume that the gerrit plugin is using the "normal" project path as seen by Windows:
//wsl$/Ubuntu-20.04/home/stephen/dev/work/acme
However, IDEA executes the git command directly in the linux subsystem, so the prefix must be removed: /home/stephen/dev/work/acme
I would guess that there is some logic in IDEA itself that handles this translation of file paths. I am not sure, if it is always so easy as just remove the //wsl$/ prefix and the first component after that.

@uwolfer
Copy link
Owner

uwolfer commented May 30, 2021

Thanks for your feedback. Do you know if any other Git operation executed directly by IntelliJ works as expected? Do only plugin triggered Git operations fail?

@eekboom
Copy link
Contributor Author

eekboom commented May 30, 2021

Yes, it seems that way:
The standard git operations like fetch and push work fine. However it seems that the command lines for that command do not include the file path at all (instead the commands are just executed with the current directory == project path).
It's only the gerrit plugin triggered actions that fail.

@uwolfer uwolfer added bug and removed question labels May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants