andy-5 / wslgit

Use Git installed in Bash on Windows/Windows Subsystem for Linux (WSL) from Windows and Visual Studio Code (VSCode)
MIT License
1.19k stars 59 forks source link

Unusably slow diffs #44

Closed slikts closed 5 years ago

slikts commented 6 years ago

It'd be fine if just the commit was slow, but using wsligit makes the diffs just too slow to be usable. Is there some way to limit wslgit to just the commits?

andy-5 commented 6 years ago

Have you tried setting the Windows environment variable WSLGIT_USE_INTERACTIVE_SHELL to false, as mentioned in the Readme?

This should significantly speed up wslgit, but it assumes that you do not rely on anything in .bashrc to be run before git (like e.g. ssh-agent or similar tools).

Other than that, I don't think you can configure different git versions for different commands in VS Code. In the latest release, wslgit only does additional work on the output of a few selected commands (diff not included). In most cases, input and output is directly passed to/from git. So the overhead is likely from bash, which can be circumvented using above flag.

slikts commented 5 years ago

Thanks, setting that variable worked, although I'm not sure why it wouldn't be the default behavior.

andy-5 commented 5 years ago

Great, thanks for reporting back.

The current behavior is mainly for historic and compatibility reasons. The first versions used interactive bash sessions because wsl.exe was not around back then and it is common to start tools like ssh-agent or gpg-agent for key management in .bashrc, which, by default, is only fully executed for interactive shells.

But I may make the improved behavior the default in the future.