opam
opam copied to clipboard
opam source should not prompt for user login
Hi,
I have a program where I run opam source --dev-repo on a whole repository, and I don't care if some of them fail. But I don't want the program to stop and wait for my input indefinitely.
You can reproduce with opam source --dev-repo bimap (which had a wrong dev-repo field, but I opened a PR so it may not be the case any soon). But you get the same with git clone https://github.com/pat227/bimap.git.git.
The repository doesn't exist, but as GitHub doesn't want to leak private repository names, they ask your login even if it doesn't exist.
There's a fix to it, using: GIT_TERMINAL_PROMPT=0 git clone https://github.com/pat227/bimap.git.git, it'll will fail properly.
Cross-referencing https://github.com/ocaml/opam/issues/3038#issuecomment-326979380 but just because GIT_TERMINAL_PROMPT=0 may not work in every single instance doesn't mean we shouldn't be doing it!
related https://github.com/ocaml-opam/opam-publish/issues/155