When a repository name has already been assigned (globally, but the user isn't aware) and added to one switch, then tried to be added with another url in another switch, the error message can be a bit confusing:
[ERROR] Repository repo is already set up and points to https://example.org/repo. To change that, use 'opam repository set-url repo https://example.org/repo2'.
I think the information that the mapping is global and that the set up may have happened in another switch should be made more explicit.
Maybe something like this?
[ERROR] Repository repo has already been globally set up and points to https://example.org/repo.
To add the repository to the current switch with this address, use 'opam repository add repo';
to change the address, use 'opam repository set-url repo https://example.org/repo2'.
When a repository name has already been assigned (globally, but the user isn't aware) and added to one switch, then tried to be added with another url in another switch, the error message can be a bit confusing:
[ERROR] Repository repo is already set up and points to https://example.org/repo. To change that, use 'opam repository set-url repo https://example.org/repo2'.I think the information that the mapping is global and that the set up may have happened in another switch should be made more explicit.
Maybe something like this?