-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Merging branch produces path error #2677
Comments
you should add & "D:/Program Files/Git/cmd/git.exe" -C "d:/AppsWeb/nexus-angular" -c "core.editor=code --wait --reuse-window" merge dev |
@JoelLeach Sorry for the trouble -- this broke as part of another fix to run the Git command without relying on it being in the PATH. It looks like when we are trying to get the short version of "D:\Program Files\Git\cmd\git.exe" we are failing. Can you run this command from the Windows Command Prompt and post the output? Thanks!
|
@JoelLeach Another question -- does |
I just published a new pre-release version with more logging and a fallback for Powershell (assuming I can detect it properly). Can you please see if this issue is still reproducible in the pre-release edition of GitLens? Thanks! You can switch to the pre-release edition of GitLens, by clicking on the "Switch to Pre-Release version of this extension" from the Extensions view. |
Thanks for jumping on this quickly. I have switched to the pre-release version, and I will let you know what happens with my next merge. In the meantime, here are answers to your other questions:
Here is the result: Yes, that file/path does exist on my system. FYI, I manually created D:\Program Files (with similar permissions to C:\Program Files) for development tools, but Windows does not produce a shortened path without spaces for it. dir /x reveals that short paths are only produced for my C: and not the other drives. There is a way to force it (https://superuser.com/a/792852), but it's probably not something you want to depend upon. |
This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks! |
Sorry for the delay. Merging a branch now works for me as well with the latest pre-release version. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
I updated VS Code and GitLens to the latest versions today on Windows 11, and I am now receiving an error when I merge a branch into the current branch. I'm not sure which versions I was on before, but I did not have the issue until updating. Note that I have Git installed in an odd location (D:\Program Files), but I think the same issue would occur if installed in C:\Program Files. To reproduce:
I restarted VS Code after I encountered the error the first time, but that did not help. It's obvious that Windows doesn't like the spaces in the path name. (I thought that Windows cmd could find paths like this even without quotes, but apparently that is no longer the case). I expected that adding quotes around the path would fix the issue, but instead it caused git parsing errors:
The merge was successful after removing the full path from git.exe, because D:\Program Files\Git\cmd is in my Windows path.
git.exe -C "d:/AppsWeb/nexus-angular" -c "core.editor=code --wait --reuse-window" merge dev
GitLens Version
13.6.0
VS Code Version
Version: 1.78.2 (system setup)
Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
Date: 2023-05-10T14:39:26.248Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: Yes
Git Version
git version 2.37.3.windows.1
Logs, Screenshots, Screen Captures, etc
No response
The text was updated successfully, but these errors were encountered: