hangxingliu / wslgit

:candy: Use Git installed in WSL(Windows Subsystem for Linux) from Windows and Visual Studio Code
GNU General Public License v3.0
150 stars 18 forks source link

`git` commands not supported #9

Open neighthan opened 5 years ago

neighthan commented 5 years ago

Thanks for the repo! It worked fine for me with VS code, and I was inspired to write a couple of wrappers for other tools that I wanted to install on Linux and use on Windows (pdf2svg and pdflatex; my wrappers aren't terribly sophisticated, but they work for what I need).

I have come across some issues using git with your scripts such as trying to install packages from GitHub using pip; a batch file doesn't work for this, but I made an exe out of git.bat. That helped a bit (now Python can see the git command). Still, installing things gives me issues, but I haven't dug into pip's code to see what git commands are causing this. I was just wondering, do you know of specific use cases where calling git from Windows with your scripts will fail? If so, could those be listed in the README or somewhere as cases that aren't supported yet? I'll post back if I figure out what commands exactly were causing the problems I saw, but I might revert back to normal git for Windows for now.

joaopluigi commented 5 years ago

Hey @neighthan, @hangxingliu described this possible problem in another issue:

Because it is hard to know which part of output should be converted. For example, you mounted your drive D on /d/ in WSL. And there have /a/b/c/d/e/f/g in output of your python script. Then the converter be convert in to /a/b/c/D:\e/f/g.

Originally posted by @hangxingliu in https://github.com/hangxingliu/wslgit/issues/4#issuecomment-463143780

I'm not total sure if this is related to your issue, but it looks like a very reasonable problem when working with pip. I would recommend trying to turn on the log and print the to_win_path_by_awk function result to see if you can catch that.

hangxingliu commented 5 years ago

@neighthan You can follow the way @joaopluigi posted.

Modify the line WSLGIT_SH_LOG=${WSLGIT_SH_LOG:-false}; in the wslgit.sh to WSLGIT_SH_LOG=true. And you can get the debug info in file wslgit.log at the same directory of wslgit.sh

MostHated commented 5 years ago

I don't seem to be getting a log at all and I just keep getting a permission denied error. I am trying to use SSH though, not sure if that makes a difference?

/usr/bin/wslgit.sh: line 126: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 127: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 128: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 129: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 129: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 129: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 177: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 178: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 179: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 179: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 179: /usr/bin/wslgit.log: Permission denied /usr/bin/wslgit.sh: line 180: /usr/bin/wslgit.log: Permission denied

Edit, it looks like it works fine if I switch to https and then use a portable windows git credential manager. Oh well, I guess?

hangxingliu commented 5 years ago

@MostHated I will fix the permission trouble of logging later