Closed lambdalisue closed 7 years ago
@bimlas
Could you test this branch on Windows?
:Gina push
works OK with procedure below (Optional, if you have enough time and you are OK to install win-ssh-agent)GIT_ASKPASS
environment variable, git config --global core.askpass=...
, or SSH_ASKPASS
let $GIT_TERMINAL_PROMPT = '0'
on your vimrc (WARN: This should be temporal during this test)git clone https://github.com/lambdalisue/gina.vim
:Gina push
on the repository. If a GUI prompt comes up, it seems successes 👍 Note:
My friend @Yudaidhun is going to make an internal askpass program for Windows 👍 He has already built a tiny (4k) program and it seems working well but he is new to github so we need to wait until he discover how to create a repository and collaborate in github. Once that tiny program has become ready, I'll put it into this plugin as a default askpass program for user who do not have win-ssh-askpass.
The behaviour is equivalent in both branches without win-ssh-askpass.
Sorry, but I'm not familiar with Cygwin, thus I cannot try out win-ssh-askpass. It seems for me that the program runs only on Cygwin (a "Linux-emulator" for Windows) - if this is right, then the feature will heavily affect the Windows-compatibility of Gina, because the official installer use Msys (another "Linux-emu").
I had a mistake: I installed Git with wincred (credential storage for Windows) and set up in .gitconfig. Before the test (pushing a repository) I deleted the relevant line from the config and noticed that Gina opens the GUI to ask password (as Git does from the command line too).
Later I found the proper way to disable credential storage and ran the test again: the push
not works in both of master
and askpass
because the terminal prompt cannot be opened.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument
I deleted the relevant line from the config and noticed that Gina opens the GUI to ask password (as Git does from the command line too).
It sounds a good news. So did you mean if Windows user use wincred
which is an official version of git credentail, a GUI prompt comes up even in gina.vim? If so, what Windows user need to do is just execute $ git config --global credential.helper wincred
and people can enter password right?
As the PR comment said, this problem exist on Linux/Mac while without proper configuration and software, Linux/Mac user cannot enter password because a terminal version is used. So if an official credentail for Windows use a GUI version, everything would become OK :+1:
Well yeah, wincred
is the official credential manager on Windows but it needs additional installation of Microsoft .NET Framework so it's not works as is on all system. BTW it's the most usable solution for GUI askpass.
If it is an official, I think I should stack on that. Thanks for the information :+1:
It seems a CUI based askpass which git provides ('get_terminal_prompt' in git code) does not works properly in job process. To fix the issue (issue #6), this commit disable CUI based prompt via $GIT_TERMINAL_PROMPT=0 and try to use GUI based prompt.
Linux: User should assign 'gnome-ssh-askpass' to '$GIT_ASKPASS', 'git config --global core.askpass', or '$SSH_ASKPASS'. If non of settings exist, it use a gina's internal askpass script when 'zenity' is available. Otherwise an operation which requires askpass always fail. Note that users may need to specify an absolute path. Use
locate gnome-ssh-askpass
then.Mac: AFIK, there is no usable GUI based askpass exists on Mac. However, a gina's internal askpass script should works fine on any Mac environment. If non of settings exist, it use a gina's internal askpass script which use AppleScript internally.
Windows: It seems 'win-ssh-askpass' exists for this purpose. User can try to assign that to '$GIT_ASKPASS', 'git config --global core.askpass', or '$SSH_ASKPASS'. If non of settings exist, an operation which requires askpass always fail while there is no gina's internal script because I don't know Windows well enough. (PR or snippet or any suggestions for making an internal script for Windows is welcome)