-
-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shell gets stuck in a loop if private git repo and using https without authentication #76
Comments
Yeah, that makes sense. Any idea how to detect that? |
I'm currently looking into it... It seems one needs to play with The problematic line is edit - just updating that I currently didn't find any workable solution for this (except for caching credentials or switching to a git:// or not using private repos) |
Just got this issue as well. What about using github api (without auth) to detect if a repo is private (cause without auth you will be able to just see public repo) & use a cache somewhere to save this ? As a workaround, to avoid loop, when username is prompted I just use a |
Using github api would only work when the repo is github. I have lots of repos scattered about on bitbucket, gitlab, and my uni's enterprise github. This serverfault question suggests redirectiong the stdout somehow, not sure if it helps: http://serverfault.com/questions/544156/git-clone-fail-instead-of-prompting-for-credentials |
Not going to make it GitHub specific. Pure is already running non-interactively so nothing should be prompted. Happy to receive a PR with a fix but I have no idea how to fix this. |
Maybe a comment in a FAQ section in the README is a start :) (quick fix: type git pull to auth) |
@MoOx Sure, if you care enough to do a PR. |
This has been fixed in git 2.3 :D See: f43ab97 |
Very nice. |
I still get this error on my Mac with git version 2.3.5. |
Same here, running pure prompt 0.5.1 on Yosemite with git 2.3.5. |
@fkirkholt @dalymatthew are you sure you aren't resetting the echo $GIT_TERMINAL_PROMPT ? |
~
λ echo $GIT_TERMINAL_PROMPT
0 My ~/.zshrc and ~/.zshrc.local are just stock grml, apart from the following in the latter: autoload -U promptinit && promptinit
PURE_PROMPT_SYMBOL=λ
prompt pure I double-checked and |
Well, then I'm out of ideas. Unable to reproduce. |
by running the commands in pure.zsh one at a time i found this one to be the one which prompts: > command git -c gc.auto=0 fetch &>/dev/null is it a git bug? |
@neonstalwart either |
@mafredri git version is 2.4 and GIT_TERMINAL_PROMPT is 0 - with that exact command above i see a prompt for a password. i'm trying to make sense of it. |
Tried upgrading to 2.4.0, still cannot reproduce: ❯ GIT_TERMINAL_PROMPT=0 command git -c gc.auto=0 fetch
fatal: could not read Password for 'https://[email protected]': terminal prompts disabled |
so, in my case it was ssh which was prompting for the password. my remote is actually > GIT_TRACE=true GIT_TERMINAL_PROMPT=0 command git -c gc.auto=0 fetch
11:54:32.597755 git.c:348 trace: built-in: git 'fetch'
11:54:32.600003 run-command.c:347 trace: run_command: 'ssh' '[email protected]' 'git-upload-pack '\''path/to/repo.git'\'''
Password: updated ~/.ssh/config with the following and it stops prompting now
|
I am not sure if this is exactly the same issue (or whether this is even fixed for everyone), but I was having a similar problem while running a set -x GIT_ASKPASS /bin/echo which translated to bash gives export GIT_ASKPASS=/bin/echo |
Steps to reproduce:
Shell then asks for git username, but anything you enter is evaluated as a zsh command, meaning you can't even try to actually login.
I think that the solution would be to detect if user doesn't have read permissions in a git repo - and then don't try to async evaluate remote git status (for git pull/push).
Hope that makes sense... Ran into this issue in several colleagues workspace where they used https in private repos.
The text was updated successfully, but these errors were encountered: