Open PhilipRoman opened 6 years ago
Thank you for contributing !!!
Failed collect git remove infos. exit status 128.
This error is caused by do git remote
failing.
Please move to the error repository on your console and confirm that you can do git remote
.
Unfortunately I do not have Windows so I can not reproduce your error. I need your cooperation to resolve this error.
Of course you are also welcome to pull request.
I added code for error tracking of Git command with this commit. If you install and run this release binary you can see more detailed error.
Reinstallation can be done by executing the command below.
curl -s https://raw.githubusercontent.com/lighttiger2505/lab/master/install.sh | bash
Okay, I think I have this figured out.
My Windows file system is mounted on /mnt/c
A long time ago I noticed that git
from linux has trouble with files within /mnt/c
but git.exe
from windows could not access files unless they were in /mnt/c
. I solved this by aliasing git
to `if inwindows; then echo git.exe; else echo git; fi`
- choosing between git
and git.exe
depending on current directory.
Now, lab
obviously calls git
without doing any shell expansions and thus it fails when inside /mnt/c
. For the record, here is the error: fatal: Could not chdir to 'C:/Users/usr/xxx: No such file or directory
.
There should be some way of configuring the git command that is called, maybe an env variable or command line option (something like alias lab='lab --git-cmd=...'
)?
Unfortunately I'm not too familiar with Go so I can't PR.
Also, thank you for the commit - I never would've figured it out without it!
Please let me check.
/mnt/c
) results in an error.
Because git is executed instead of git.exe which should be aliased.mnt/c
) results in an success.OK ?
There should be some way of configuring the git command that is called, maybe an env variable or command line option (something like alias lab='lab --git-cmd=...')?
I appreciate your suggestion.
But I think your case is special. I think that it is better to use the git command in an appropriate place rather than using it differently depending on the location.
If possible we want you to use lab on the linux file system.
Yeah, lab works good outside of /mnt/c
. Unfortunately I can't move the repo to the linux file system. Even if this is an edge case, I don't think that option to choose custom git command would be difficult to implement or maintain. If not, I can always fork this, implement the patch and use my own forked version. Thank you for helping me resolve this!
Hmmm...
I was thinking about adding --git-cmd
option, but I thought it would be bad to add specific environment dependent options.
Because the git command does not need to switch at all in a general unix/linux environment.
I may not start with this issue at once, but I would like to think about other methods.
Actually I guess I should just rename git
to git-real
and create my own script called git
. This should be a fairly robust solution.
I installed the binary but any sub-command (other than simply typing "lab") will show this error message:
Failed collect git remove infos. exit status 128.
. Git is installed and works correctly. I am using Windows Subsystem for Linux.