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

Git history log failed on MSYS2 #126

Closed
ipsusila opened this issue May 9, 2017 · 2 comments
Closed

Git history log failed on MSYS2 #126

ipsusila opened this issue May 9, 2017 · 2 comments

Comments

@ipsusila
Copy link

ipsusila commented May 9, 2017

Hello,
thank you for the great work. I'm facing the following issue when using MSYS2 git.

  1. I follow the suggestion #4651 to use MSYS2 git in VSCode.
  2. Git History Log give me The system cannot find the file specified. error.

If I do not perform (1), Git History Log works fine. However, I can not use git from inside vs-code.

Operating system: Windows 10 (64-bit)
git version 2.12.1
MSYS2

@ipsusila
Copy link
Author

After looking into the source code again, I found that this issue is related to
https://nodejs.org/api/child_process.html#child_process_spawning_bat_and_cmd_files_on_windows

The code in gitHistory.ts uses spawn to start git process. As stated in the node documentation:

... When running on Windows, .bat and .cmd files can be invoked using child_process.spawn() with the shell option set, with child_process.exec(), or by spawning cmd.exe and passing the .bat or .cmd file as an argument ...

In my case, setting shell option, i.e. change the code line

const options = { cwd: rootDir };

to

const options = { cwd: rootDir, shell: 'cmd.exe' };

fixed the problem.

@DonJayamanne
Copy link
Owner

Closing this issue due to inactivity

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