opam icon indicating copy to clipboard operation
opam copied to clipboard

opam source should not prompt for user login

Open zapashcanon opened this issue 4 years ago • 1 comments

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.

zapashcanon avatar Aug 25 '21 13:08 zapashcanon

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!

dra27 avatar Sep 03 '21 08:09 dra27

related https://github.com/ocaml-opam/opam-publish/issues/155

rjbou avatar Aug 22 '23 13:08 rjbou