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.18k stars 59 forks source link

Select best Git #133

Closed arBmind closed 1 year ago

arBmind commented 1 year ago
andy-5 commented 1 year ago

Thank you for your contribution.

Unfortunately, I think that these changes don't match the design of wslgit very well.

Feel free to open an issue to discuss your proposed changes more in depth. I'll keep this PR open for now as a reminder and to allow others to comment, but I probably won't merge it in its current form.

arBmind commented 1 year ago

Unfortunately, I think that these changes don't match the design of wslgit very well.

I can understand your reasoning. This goes beyond the current intend of wslgit. I will use the tool as long as it fits my use cases.

  • selecting native git: I feel like this does not belong into wslgit, but should rather be its own tool. This feature does not need or use any of the functionality of wslgit, but complicates the execution logic quite a bit. The focus of wslgit is just to be a bridge to call git installed inside WSL from Windows.

The use case is simply that using the native git is always the fastest, as it does not have to go through an extra OS-abstraction layer. I thought about an extra tool. But as wslgit discovers the git root, which is quite an effort. It can easily be used for this kind of reasoning. I would also like to split the two code paths better, but if this feature does not align with the goals, why waste more effort here.

  • using a login shell: Starting a login shell from a tool like wslgit seems wrong to me. If you need to set something up for git to work, it should be configured for an interactive shell (i.e. typically in .bashrc). Interactive shells are already automatically used by wslgit for certain commands, and it can also be configured to always use an interactive shell.

In my use case, I have installed Git using nix-env. The nix-env is created in .profile. Maybe I use it wrong. But the solution I found was, suggested to use the login shell.

Feel free to open an issue to discuss your proposed changes more in depth. I'll keep this PR open for now as a reminder and to allow others to comment, but I probably won't merge it in its current form.

I don't have any issue with wslgit. It's a cool tool and does the intended job. 👍 I extended the code for my use case, because I liked the challenge.

I'm open for suggestions and won't feel offended if you decide to not merge my random pull request.