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

Confused by opam remote remove when remote does not exist #5012

Open
emillon opened this issue Jan 20, 2022 · 1 comment · May be fixed by #5014
Open

Confused by opam remote remove when remote does not exist #5012

emillon opened this issue Jan 20, 2022 · 1 comment · May be fixed by #5014

Comments

@emillon
Copy link
Contributor

emillon commented Jan 20, 2022

Hi,

Here's a shell session that confused me a bit:

 % opam remote
[...]
<><> Repository configuration for switch 4.13.1 <><><><><><><><><><><><><><><><>
 1 another-repo  git+https://github.com/...
 2 default       git+https://github.com/ocaml/opam-repository

 % opam remote remove 1
Repositories removed from the selections of switch 4.13.1. Use '--all' to forget about them altogether.

 % opam remote         
[...]
<><> Repository configuration for switch 4.13.1 <><><><><><><><><><><><><><><><>
 1 another-repo  git+https://github.com/...
 2 default       git+https://github.com/ocaml/opam-repository

 % opam remote remove another-repo
Repositories removed from the selections of switch 4.13.1. Use '--all' to forget about them altogether.

 % opam remote                     
[...]
<><> Repository configuration for switch 4.13.1 <><><><><><><><><><><><><><><><>
 1 default git+https://github.com/ocaml/opam-repository

The confusing part is that I tried to use the number instead of the remote name, but opam remote removed silently did nothing. I think that it should error out or at least warn that it did nothing (I also confused the priority with an id, that part is more on me).

@rjbou
Copy link
Collaborator

rjbou commented Jan 20, 2022

it's confusing, but in fact it updated your switch by removing the nonexistent repo 1 :D
More seriously, yes, we should at least check that it exists and display something.

@rjbou rjbou added the AREA: UI label Jan 20, 2022
@rjbou rjbou added this to the 2.2.0~alpha milestone Feb 4, 2022
@rjbou rjbou added this to To do in Opam 2.2.0 via automation Feb 4, 2022
@rjbou rjbou moved this from To do to In progress in Opam 2.2.0 Feb 4, 2022
@dra27 dra27 removed this from In progress in Opam 2.2.0 Jan 23, 2023
@dra27 dra27 added this to To do in Opam 2.3 via automation Jan 23, 2023
@dra27 dra27 removed this from the 2.2.0~alpha milestone Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Opam 2.3
  
To do
Development

Successfully merging a pull request may close this issue.

3 participants