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

Allow git fetch to ask for password #4447

Closed
wants to merge 1 commit into from

Conversation

Blaisorblade
Copy link
Contributor

Problem: git fetch can ask for a password, but that fails without allow_stdin. Tentative fix: pass allow_stdin.

  • Untested as opam fails to compile, so take it as pseudocode.
  • Please update master_changes.md file with your changes.

Untested as `opam` fails to compile, so take it as pseudocode.
@Blaisorblade
Copy link
Contributor Author

The testing failure was due to #4448; backporting to 2.0 fails because 2.0 doesn't build on dune 2.7.1.

@AltGr
Copy link
Member

AltGr commented Jan 11, 2021

At the very least you will need to enforce download_jobs=1 for this to be a viable option. It's actually annoying that we can't let git understand that it shouldn't ask for password just by providing it with a closed stdin... but we haven't found a workaround for that.

@Blaisorblade
Copy link
Contributor Author

Blaisorblade commented Feb 26, 2021

FWIW, the status here is that I don’t know what download_jobs=1 means (I should probably check).

@dra27
Copy link
Member

dra27 commented Mar 17, 2021

FWIW, the status here is that I don’t know what download_jobs=1 means (I should probably check).

You'd want to set OPAMDOWNLOADJOBS=1 before running, otherwise you could end up with multiple jobs in parallel prompting.

Git does have core.askPass, so this, for example, errors properly: git -c core.askPass=echo https://github.com/dra27/my-secret-hidden-repo, but we shouldn't go doing that by default because it also stops my perfectly valid and non-interactive credential manager from jumping in with a token!

Another option might be to open the Git process with a pipe to stdin and write a few newlines to it. I'm more focused on wanting it to fail in these cases, not ever prompt for a password...

@dra27
Copy link
Member

dra27 commented Jun 25, 2021

We discussed this PR this morning. Thanks for your work on this, however our conclusion is that this isn't the direction to go in. We'd rather aim to ensure (as far as git, etc. allow) that opam doesn't block on these commands - i.e. instructing the commands being called that they're not permitted to be interactive.

@dra27 dra27 closed this Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants