Skip to content
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

git sync --pull, git submit hang indefinitely when asking for password #433

Open
arxanas opened this issue Jun 30, 2022 · 2 comments
Open
Labels
bug Something isn't working

Comments

@arxanas
Copy link
Owner

arxanas commented Jun 30, 2022

Description of the bug

This happens when we're being prompted interactively for a password e.g. to authenticate with Github over HTTPS. Askpass-style programs do not read stdin/write stdout, so #429 doesn't help. Instead, they directly read/write to the terminal (so that the password is hidden).

Furthermore, if the askpass program fails, it seems that Git falls back to prompting on the terminal manually, so there's no way to cancel asking for the password. For example, even when exit 1ing:

$ GIT_ASKPASS='./askpass.sh' git sync -p
branchless: running command: git fetch --all
Fetching origin
Fetching github
exiting 1
error: unable to read askpass response from './askpass.sh'
⠁ Running Git command: git fetch --all (13.1s)
^C

$ cat askpass.sh 
#!/bin/sh
echo >/dev/stderr 'exiting 1'
exit 1

Expected behavior

Either the password is prompted or the operation fails immediately.

Actual behavior

Hangs forever.

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

No response

Version of git

No response

@arxanas arxanas added the bug Something isn't working label Jun 30, 2022
@cloudhan
Copy link

You might consider #574

So, in my opinion, sync should not fetch, should not have network activities involved. It should just automatically move all my working commit to a dest.

pull is an extremely easy command, un-pull is not! So just handle the control back to user will solve all your headache.

@arxanas arxanas changed the title git sync --pull hangs indefinitely when asking for password git sync --pull, git submit hang indefinitely when asking for password Jan 18, 2023
@arxanas
Copy link
Owner Author

arxanas commented Jan 18, 2023

My workaround is to do the following before a command which runs git fetch:

In my case, I use ssh-agent and ssh-add -K /path/to/key (on macOS) to unlock the key, and then git sync --pull works for me. Does that workaround work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants