├── .gitignore ├── .travis.yml ├── GitWrap.sln ├── GitWrap ├── App.config ├── GitWrap.csproj ├── PathConverter.cs ├── Program.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Settings.Designer.cs │ └── Settings.settings ├── GitWrapTests ├── GitWrapTests.csproj └── PathConverterTest.cs ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp # Language 2 | solution: GitWrap.sln # Solution name 3 | -------------------------------------------------------------------------------- /GitWrap.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2003 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitWrap", "GitWrap\GitWrap.csproj", "{5020A057-E361-443B-80D1-0A28CF403439}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitWrapTests", "GitWrapTests\GitWrapTests.csproj", "{7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|x64 = Debug|x64 14 | Release|Any CPU = Release|Any CPU 15 | Release|x64 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {5020A057-E361-443B-80D1-0A28CF403439}.Debug|Any CPU.ActiveCfg = Debug|x64 19 | {5020A057-E361-443B-80D1-0A28CF403439}.Debug|Any CPU.Build.0 = Debug|x64 20 | {5020A057-E361-443B-80D1-0A28CF403439}.Debug|x64.ActiveCfg = Debug|x64 21 | {5020A057-E361-443B-80D1-0A28CF403439}.Debug|x64.Build.0 = Debug|x64 22 | {5020A057-E361-443B-80D1-0A28CF403439}.Release|Any CPU.ActiveCfg = Release|x64 23 | {5020A057-E361-443B-80D1-0A28CF403439}.Release|Any CPU.Build.0 = Release|x64 24 | {5020A057-E361-443B-80D1-0A28CF403439}.Release|x64.ActiveCfg = Release|x64 25 | {5020A057-E361-443B-80D1-0A28CF403439}.Release|x64.Build.0 = Release|x64 26 | {7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}.Debug|x64.ActiveCfg = Debug|x64 29 | {7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}.Debug|x64.Build.0 = Debug|x64 30 | {7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}.Release|x64.ActiveCfg = Release|x64 33 | {7CCBFDB7-98FF-46EE-8DE3-4320211E1BA3}.Release|x64.Build.0 = Release|x64 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {D84CBC04-7E66-4C7B-A43E-3216868EAA8D} 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /GitWrap/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | /mnt/ 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /GitWrap/GitWrap.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5020A057-E361-443B-80D1-0A28CF403439} 8 | Exe 9 | Properties 10 | GitWrap 11 | GitWrap 12 | v4.6.2 13 | 512 14 | true 15 | 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | true 38 | bin\x64\Debug\ 39 | DEBUG;TRACE 40 | full 41 | x64 42 | prompt 43 | MinimumRecommendedRules.ruleset 44 | true 45 | 46 | 47 | bin\x64\Release\ 48 | TRACE 49 | true 50 | pdbonly 51 | x64 52 | prompt 53 | MinimumRecommendedRules.ruleset 54 | true 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | True 72 | True 73 | Settings.settings 74 | 75 | 76 | 77 | 78 | 79 | SettingsSingleFileGenerator 80 | Settings.Designer.cs 81 | 82 | 83 | 84 | 91 | -------------------------------------------------------------------------------- /GitWrap/PathConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace GitWrap 5 | { 6 | public class PathConverter 7 | { 8 | // Convert Windows style paths submitted to GitWrap to their Linux style equivalent 9 | public static string convertPathFromWindowsToLinux(String path) 10 | { 11 | // Translate directory structure. 12 | // Use regex to translate drive letters. 13 | string pattern = @"(\D):\\"; 14 | string argstr = path; 15 | foreach (Match match in Regex.Matches(path, pattern, RegexOptions.IgnoreCase)) 16 | { 17 | string driveLetter = match.Groups[1].ToString(); 18 | argstr = Regex.Replace(path, pattern, Properties.Settings.Default.wslpath + driveLetter.ToLower() + "/"); 19 | } 20 | 21 | // Convert Windows path to Linux style paths 22 | argstr = argstr.Replace("\\", "/"); 23 | // Escape any whitespaces 24 | argstr = argstr.Replace(" ", "\\ "); 25 | // Escape parenthesis 26 | argstr = argstr.Replace("(", "\\("); 27 | argstr = argstr.Replace(")", "\\)"); 28 | return argstr; 29 | } 30 | 31 | // Convert output paths from WSL git to Windows style equivalent. 32 | // For now we only convert forward slashes to backslashes if our regex pattern for 33 | // absolute paths get a match. If not we will end up converting urls, and other stuff too. 34 | public static string convertPathFromLinuxToWindows(String path) 35 | { 36 | bool foundDrivePath = false; 37 | string drivePathPattern = String.Format(@"{0}(\D)/", Properties.Settings.Default.wslpath); 38 | string argstr = path; 39 | 40 | foreach (Match match in Regex.Matches(path, drivePathPattern, RegexOptions.None)) 41 | { 42 | string driveLetter = match.Groups[1].ToString(); 43 | argstr = Regex.Replace(path, drivePathPattern, driveLetter.ToUpper() + ":\\"); 44 | // Convert Linux style path separators to Windows style equivalent 45 | argstr = argstr.Replace("/", "\\"); 46 | foundDrivePath = true; 47 | } 48 | 49 | if (foundDrivePath) 50 | { 51 | argstr = argstr.Replace("/", "\\"); 52 | } 53 | return argstr; 54 | } 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /GitWrap/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace GitWrap 7 | { 8 | class Program 9 | { 10 | private static int outputLines = 0; 11 | 12 | static void Main(string[] args) 13 | { 14 | if (args.Length > 0 && args[0] == "--setWslPath" && args.Length == 2) 15 | { 16 | Properties.Settings.Default.wslpath = args[1]; 17 | Properties.Settings.Default.Save(); 18 | Console.Write("[*] wslPath set to: " + args[1]); 19 | } else if (args.Length > 0 && args[0] == "--getWslPath") { 20 | Console.Write("[*] Current wslPath: " + Properties.Settings.Default.wslpath); 21 | } 22 | else 23 | { 24 | executeGitWithArgs(getWslPath(), args); 25 | } 26 | } 27 | static void executeGitWithArgs(String wslPath, string[] args) 28 | { 29 | if (!File.Exists(wslPath)) 30 | { 31 | Console.Write("[-] Error: wsl.exe not found."); 32 | return; 33 | } 34 | 35 | ProcessStartInfo bashInfo = new ProcessStartInfo(); 36 | bashInfo.FileName = wslPath; 37 | 38 | // Loop through args and pass them to git executable 39 | StringBuilder argsBld = new StringBuilder(); 40 | argsBld.Append("git"); 41 | 42 | for (int i = 0; i < args.Length; i++) 43 | { 44 | argsBld.Append(" " + PathConverter.convertPathFromWindowsToLinux(args[i])); 45 | } 46 | 47 | bashInfo.Arguments = argsBld.ToString(); 48 | bashInfo.UseShellExecute = false; 49 | bashInfo.RedirectStandardOutput = true; 50 | bashInfo.RedirectStandardError = true; 51 | bashInfo.CreateNoWindow = true; 52 | 53 | var proc = new Process 54 | { 55 | StartInfo = bashInfo 56 | }; 57 | 58 | proc.OutputDataReceived += CaptureOutput; 59 | proc.ErrorDataReceived += CaptureError; 60 | 61 | proc.Start(); 62 | proc.BeginOutputReadLine(); 63 | proc.BeginErrorReadLine(); 64 | proc.WaitForExit(); 65 | } 66 | 67 | static void CaptureOutput(object sender, DataReceivedEventArgs e) 68 | { 69 | printOutputData(e.Data); 70 | } 71 | 72 | static void CaptureError(object sender, DataReceivedEventArgs e) 73 | { 74 | printOutputData(e.Data); 75 | } 76 | 77 | static String getWslPath() 78 | { 79 | return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), 80 | @"System32\wsl.exe"); 81 | } 82 | 83 | static void printOutputData(String data) 84 | { 85 | if (data != null) 86 | { 87 | if (outputLines > 0) 88 | { 89 | Console.Write(Environment.NewLine); 90 | } 91 | // Print output from git, converting WSL paths to Windows equivalents. 92 | Console.Write(PathConverter.convertPathFromLinuxToWindows(data)); 93 | outputLines++; 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /GitWrap/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GitWrap")] 9 | [assembly: AssemblyDescription("Windows wrapper for Linux git")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("ardevd")] 12 | [assembly: AssemblyProduct("GitWrap")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5020a057-e361-443b-80d1-0a28cf403439")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.2.0.1")] 36 | [assembly: AssemblyFileVersion("0.2.0.1")] 37 | -------------------------------------------------------------------------------- /GitWrap/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace GitWrap.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.1.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("/mnt/")] 29 | public string wslpath { 30 | get { 31 | return ((string)(this["wslpath"])); 32 | } 33 | set { 34 | this["wslpath"] = value; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /GitWrap/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | /mnt/ 7 | 8 | 9 | -------------------------------------------------------------------------------- /GitWrapTests/GitWrapTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | false 7 | 8 | AnyCPU;x64 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /GitWrapTests/PathConverterTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using GitWrap; 3 | 4 | namespace GitWrapTests 5 | { 6 | [TestClass] 7 | public class PathConverterTest 8 | { 9 | [TestMethod] 10 | public void TestConvertWindowsPathToWSLEquivalent() 11 | { 12 | // Example windows path 13 | string windowsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\testfile.txt"; 14 | // The equivalent WSL path 15 | string unixPath = "/mnt/c/Program\\ Files\\ \\(x86\\)/Microsoft\\ Visual\\ Studio/testfile.txt"; 16 | // assert that the converter method correctly converts the Windows path to its WSL style equivalent. 17 | Assert.AreEqual(unixPath, PathConverter.convertPathFromWindowsToLinux(windowsPath), false, "Windows path converted correctly to WSL equivalent."); 18 | } 19 | 20 | [TestMethod] 21 | public void TestConvertWSLPathToWindowsEquivalent() 22 | { 23 | // Example WSL Path 24 | string unixPath = "/mnt/c/Program Files (x86)/Microsoft Visual Studio/testfile.txt"; 25 | 26 | // Equivalent Windows path 27 | string windowsPath = "C:\\Program Files (x86)\\Microsoft Visual Studio\\testfile.txt"; 28 | 29 | string convertedPath = PathConverter.convertPathFromLinuxToWindows(unixPath); 30 | 31 | // assert correct conversion 32 | Assert.AreEqual(unixPath, PathConverter.convertPathFromLinuxToWindows(unixPath), false, "WSL path converted correctly to Windows equivalent."); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 archpoint 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitWrap 2 | [![pipeline status](https://api.travis-ci.org/ardevd/gitwrap.svg?branch=master)](https://travis-ci.org/ardevd/gitwrap) 3 | 4 | GitWrap is a Windows Wrapper for the Linux git executable. 5 | 6 | Windows Subsystem for Linux is pretty awesome, but managing two separate git environment is not, especially if you use SSH keys. So, here is a little workaround that lets you call git from the WSL environment through a Windows executable. 7 | 8 | GitWrap is experimental and can't be considered complete or reliable. It has been tested with Android Studio and seems to work pretty well when used with a compatible system. 9 | 10 | NOTE: Please read through the list of known issues. 11 | 12 | ## Requirements 13 | - Windows Subsystem for Linux must be installed. 14 | - Git should be installed in the Linux environment (WSL). 15 | - Supports x64 variant of Windows only. 16 | - To avoid most known issues, make sure your Windows 10 installation is fully up to date 17 | 18 | ## Installation 19 | Download the latest GitWrap release and place the executable anywhere you want. GitWrap is completely portable. Then configure your IDE's git executable path and make it point to GitWrap.exe. It should now be using git from your Linux Subsystem on Windows 10. 20 | 21 | It should work with other IDE's that allow you to specify the path to the git executable but I've only tested and verified functionality with Android Studio. 22 | 23 | To manually verify that GitWrap is working, open up a command prompt and navigate to the directory containing GitWrap.exe 24 | 25 | ``` 26 | GitWrap.exe --version 27 | git version 1.9.1 28 | ``` 29 | 30 | If you get the expected response from the --version command you should be good to go. 31 | 32 | ## Usage 33 | 34 | If you are running WSL with a non-default wslpath you can update GitWrap to use your specified path. 35 | 36 | `GitWrap.exe --setWslPath /root/mnt` 37 | 38 | You can verify the setting with `--getWslPath` 39 | 40 | 41 | ## Known Issues 42 | - Using GitWrap manually as a command line tool is a bit cumbersome. Commiting files is pretty much impossible since GitWrap cant interface with external editors for commit messages etc. You should use GitWrap with IDE's and other applications that integrate with git or interact with git directly through WSL. 43 | - Due to a [bug in WSL](https://github.com/Microsoft/WSL/issues/2592) affecting Windows 10 Fall Creators Update, GitWrap would not work when used with certain IDE's such as IDEA (including Android Studio). This has been resolved in Windows 10 build 17025 and any fully updated Windows 10 installation today should not encounter this issue. 44 | - With the initial version of Windows Subsystem for Linux it was impossible to pipe output from a Linux command directly to a Windows application. Gitwrap worked around this by piping output to a temporary file and reading the output from there. Because of this, Windows 10 Creators Update is required for GitWrap version 0.2.0.0 and newer. If you're still on an older version of Windows 10 with WSL you can use GitWrap version 0.1. 45 | 46 | If you encounter any other issues, bugs or limitations please report them! 47 | --------------------------------------------------------------------------------