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

If git.path has a space: C:\\Program' is not recognized as an internal or external command #135

Open
J-Sorenson opened this issue Jan 10, 2025 · 0 comments

Comments

@J-Sorenson
Copy link

This started occurring after updating from 0.1.21 -> 0.1.23, when GitLG started respecting the "git.path" setting from #90. It looks like we need to either quote or escape spaces in git.path. My user settings originally had this:

"git.path": "C:\\Program Files\\Git\\bin\\git.exe"

Any attempt to display the Git Log from either the status bar or repository view causes the following error:

GitLG: An unexpected error happened. Error summary: {"error_response":"'C:\\Program' is not recognized as an internal or external command,\r\noperable program or batch file.","request":{"command":"git","data":{"args":"log --graph --author-date-order --date=iso-local --pretty=format:\"^%^%^%^%^%H^%^%^%^%^%h^%^%^%^%^%aN^%^%^%^%^%aE^%^%^%^%^%ad^%^%^%^%^%D^%^%^%^%^%s\" --decorate=full --color=never -n 100 --all"},"id":10,"type":"request-from-web"}}. For details, see VSCode developer tools console. Please consider reporting this error.

No Git Log is displayed. It only shows the top status bar followed by "Loading...". I've cleared all GitLG settings from both User and Workspace preferences.

All regular VS Code git commands work fine with the git.path setting.

This is on Windows 11 23H2, VS Code 1.88.0 (latest version permitted by my company).

Current workaround is to put your desired "git" installation into PATH and remove the "git.path" setting, or install git to a path that does not contain spaces. It appears I did something that caused the setting to be applied autonomously, so it may effect other Windows users without knowledge that their settings were updated with this breaking path.

I declare this as "low priority" since the workaround is simple enough, as long as Windows users are aware of it.

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

1 participant