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

Add support for using WSL Git for configuration #461

Merged
merged 6 commits into from
Sep 24, 2021

Conversation

mjcheetham
Copy link
Collaborator

This PR enables GCM to understand values of GIT_EXEC_PATH that point to a Windows Subsystem for Linux (WSL) path, for example \\wsl$\ubuntu\usr\libexec\git-core.

This can use useful for scenarios where the user does not want to install Git for Windows or use it's configuration files, but rather use the WSL Git's view of the world.

Also add a piece of documentation that outlines how to correctly configure GCM and WSL.

Introduce a CreateProcess method on the IEnvironment component.
This will serve as a place to consolidate Process object creation that
currently exists in multiple places.
@mjcheetham mjcheetham added enhancement New feature or request platform:wsl Specific to Windows Subsystem for Linux labels Sep 21, 2021
Use the new CreateProcess method on the IEnvironment component in the
GitProcess class.
Add support for calling back to the Git executable in a Windows
Subsystem for Linux (WSL).
Assert.True(process.StartInfo.RedirectStandardError);
Assert.False(process.StartInfo.UseShellExecute);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be overkill, but we might also test that git --exec-path returns the expected value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot do this easily as we need to be invoked from a WSL distro, with specific environment variables set etc. These tests don't actually start any processes, just check that the Process object is constructed correctly, and is ready to be .Start()ed.


To do this, simply follow the [GCM installation instructions for Linux](../README.md#linux-install-instructions).

**Note:** In this scenario, because GCM is running as a Linux application

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also mean that GCM won't have a GUI available?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The answer here is "it depends". We have GUI options for GCM+Linux. If the user has "gWSL" set up, then Linux GUI apps also work and appear as windows on the Windows host.

Copy link
Contributor

@vtbassmatt vtbassmatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the doc changes and left suggestions. But overall this is a great change!

@mjcheetham mjcheetham merged commit 596cd0c into git-ecosystem:main Sep 24, 2021
@mjcheetham mjcheetham deleted the wsl branch September 24, 2021 09:32
@mjcheetham mjcheetham mentioned this pull request Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform:wsl Specific to Windows Subsystem for Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants