-
Notifications
You must be signed in to change notification settings - Fork 304
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
Fix Git detection on Mac OS and Windows #5774
Conversation
This change makes the quotation mark being passed to git, it doesn't work. Maybe it's a shell issue, can you share what's your default shell? BTW I'm getting |
On Powershell: On Windows CMD: On MacOS' ZSH and Bash: |
yeah, but when you run a command from zsh, the quotation marks are not passed to git, they are used to escape symbols inside |
please open jshell and try
|
both in CMD and Powershell I get:
On ZSH and Bash on MacOS I get:
|
This is what I get on Windows for multiple variants.
I think your problem is unrelated to quotation mark escaping, but rather to the fact that you just don't have an upstream branch set in git and we don't handle it well |
Just to clarify - IMO there's no need to add extra exclamation marks, as the current ones work on all three systems. On the other hand we need some nice handling of "git rev-parse @{u}" command if there's no upstream branch set |
This is what I get for vcpkg on Powershell:
|
Added fallback for Windows and tested successfully. |
So I tried it once again, and it seems to work correctly. This would make sense if we called the command via cmd or powershell. We would have to escape My impression is that something is broken in your machine, or JVM. If this is not true then we would have to escape much more things, not only this single git rev-parse argument. Could you please double check on any other machine or VM? |
I'll do that today. |
You are right, the problem was that I didn't have an upstream configured. |
Checklist
Discussion thread for this change
Issue number:
5773
Description of this change
Adds quoting around the git command's parameters to avoid errors in some terminal shells.