[Feature] Support for WSL git
Allows for sourcegit to use WSL git (from default distribution) when working inside a WSL directory with UNC path (i.e. \\wsl.localhost) on Windows. Dynamically chooses to use WSL git over windows git based on the filepath.
This allows users to manage WSL repos through the same windows instance of sourcegit alongside windows repos, which is a huge win for my own personal workflow. Partly based on similar WSL implementation in GitExtensions.
I don't recommend doing this. The reasons are:
-
SourceGitsupports to run on Linux platform. Users can run it in WSL distro directly. - Users can also store their local repo in Windows side, and use paths like
/mnt/<driver>/<path_to_repo>to access this repo in WSL distro side. - In this PR:
- The file system monitoring feature may not work properly. This means that users may need to manually refresh to see the latest state of the repository.
-
Open in Terminalmay not work properly.
@love-linger Thanks for the feedback, you are also right on the functionality front. The terminal should be an easy fix but I'll likely need to find some more time to investigate a proper solution for the File Watcher (which I had completely missed wasn't working), so I'll put this into draft for now, until I can get back to it.
As for the motivation for supporting this:
- If we run SourceGit in WSL directly we need to effectively run it twice in two separate instances (on windows and linux). I personally have a handful of repos under windows and a handful under WSL, so this is annoying at best. Managing lots of repositories quickly in a centralized place is one of the main pros of using a GUI for git IMO.
- Storing files in
/mnt/c/dev(which could be managed natively with windows git) for WSL isn't very practical due to major IO bottlnecks between the two. I have tried this and it effectively results in files being almost unusable for development (at least in WSL2, WSL1 does support this a bit better). - Other git GUIs like Kraken, Tower, and GitExtensions already support using WSL in this way, so it seems like a sensible idea.