microsoft / Git-Credential-Manager-for-Windows

Secure Git credential storage for Windows with support for Visual Studio Team Services, GitHub, and Bitbucket multi-factor authentication.
Other
2.86k stars 590 forks source link

Doesn't work with git installed by msys2 pacman #70

Closed eshepelyuk closed 8 years ago

eshepelyuk commented 8 years ago

Actually there's 2 issues that preventing credential manager usage when one installs git using msys2 package manager instead of git for windows installer

  1. git-credential-manager installler forces installation of git-scm, so it should be optional
  2. git-credential-manager can not be applied when downloded as an archive. It generates an error, that can not be seen because cmd window closes too quick.

Old version works fine with such git installation.

whoisj commented 8 years ago

Interesting. Did not know that the GCM had been made available via the msys2 package manager.

  1. The package from git-scm.com is Git for Windows. The GCM's setup.exe tests for the existence of Git for Windows in the system. If it doesn't find it, it downloads and installs the version of Git for Windows which was tested along side the version of GCM being installed. This is because the GCM uses Git during installation to modify ~/.gitconfig.
  2. Interesting. The installer should display error text and attempt to read from stdin, thus blocking the process from exiting, on error.

If you're looking for a version of the Git Credential Manager for Windows which doesn't download and install anything, then I recommend using the internal installer directly. The Setup.exe package performs pre-installation and then invokes git-credential-manager.exe deploy --passive --nofail to perform the actual installation. [1] [2]

Please let me know if this is enough to move you forward or not. Thanks for reporting the issue.

eshepelyuk commented 8 years ago

My message maybe confusing, GCM (git credential manager) can not be downloaded using pacman tool (msys2 package manager). I was downloading installer from this site manually.

Could you please provide a link where I can download the internal installer you've mentioned.

whoisj commented 8 years ago

Could you please provide a link where I can download the internal installer you've mentioned.

There is a gcm-v0.9-beta.3.zip archive downloadable from the releases page which contains all of the contents contained in Setup.exe. Think of it as the ZIP version of the installer.

eshepelyuk commented 8 years ago

Downloaded archive, run install.cmd Output

c:\tmp\4>git-credential-manager.exe deploy

Looking for Git installation(s)...

Deploying from 'c:\tmp\4' to 'C:\Users\Ievgenii.Shepeliuk\bin'.
  deployment failed. U_U

Press any key to continue...

git executable is available in PATH, but, to highlight it again, it is not installed via git-scm.com installer.

whoisj commented 8 years ago

Use git-credential-manager.exe deploy --passive --nofail, not install.cmd nor setup.exe.

It is the prerequisite checks that you're attempting to avoid.

Let me know how it goes.

Perhaps, setting a msys2 pacman package could be a good idea.

eshepelyuk commented 8 years ago

Running git-credential-manager.exe deploy --passive --nofail I am receiving

deployment failed. U_U
whoisj commented 8 years ago

oh :disappointed:

Well that's not happy. Was there any more information?

Is git.exe on your %path%?

Are you attempting this with cmd.exe, powershell.exe, or bash.exe as your shell?

eshepelyuk commented 8 years ago
  1. git in my %PATH%
  2. git works fine both from cmd and `bash, i.e. I can pull, push etc
  3. attempted to install GCM from cmd.exe and bash.exe
  4. didn't try powershell, in fact never used it
whoisj commented 8 years ago

Was there no other spew from the failed attempt? The simple deployment failed. U_U line is not enough for me to assist with triaging the problem.

Thanks :wine_glass:

eshepelyuk commented 8 years ago

Unfortunately, that line is the entire output produced by git-credential-manager.exe deploy --passive --nofail command, when run in both cmd.exe and bash shells.

I'd be glad to provide any other details of my setup, but not the GCM tool output, since I am not able to improve it.

whoisj commented 8 years ago

OK try git-credential-manager.exe deploy --nofail, basically omitting the --passive flag.

On a related note, I may have found a bug in the current release - thanks to this thread :smile:

eshepelyuk commented 8 years ago

Providing output from bash, in cmd.exe it is the same.

$ ./git-credential-manager.exe deploy --nofail

Looking for Git installation(s)...

Deploying from 'C:\tmp\4' to 'C:\Users\Ievgenii.Shepeliuk\bin'.
  deployment failed. U_U

Press any key to continue...

Also, I've tried to create bin folder in C:\Users\Ievgenii.Shepeliuk, and then run GCM tool again. Here's output

$ ./git-credential-manager.exe deploy --nofail

Looking for Git installation(s)...

Deploying from 'C:\tmp\4' to 'C:\Users\Ievgenii.Shepeliuk\bin'.
  Microsoft.Alm.Authentication.dll
  Microsoft.Alm.Git.dll
  Microsoft.IdentityModel.Clients.ActiveDirectory.dll
  Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
  git-credential-manager.exe
        5 file(s) copied
Fatal: ArgumentOutOfRangeException encountered.
whoisj commented 8 years ago

oh cute :disappointed:

Thanks this gives a lot to work with. I'll see what I can do.

eshepelyuk commented 8 years ago

Thank you for the patience. Hope I can help with debug and improve GCM :)

tomein commented 8 years ago

I have exactly the same problem right now with gcm-v0.9-beta.3.zip!

whoisj commented 8 years ago

Likely resolved by #111 + git config credential.modalprompt true being set.