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

Feature request: support opam switch - #4688

Closed
craigfe opened this issue May 30, 2021 · 1 comment · Fixed by #4910
Closed

Feature request: support opam switch - #4688

craigfe opened this issue May 30, 2021 · 1 comment · Fixed by #4910

Comments

@craigfe
Copy link

craigfe commented May 30, 2021

In interacting with Opam switches, I quite often find myself wanting to switch to a particular switch in order to perform a specific thing, then switch back to the switch I was on before:

$ opam switch plugin-host
$ ...                     # rebuild an opam plugin
$ opam switch irmin+4.10  # resume normal operation

The Git CLI has an idiom for this w.r.t branches, allowing git switch -:

$ git switch plugin-host
$ ...
$ git switch -             # go back to branch before `plugin-host`

(In fact, Git has a more general @{-N} syntax for referencing historic branch states, and - is a synonym of @{-1}.)

It might be nice if the opam CLI could support a similar syntax, although this would likely be a breaking change as it's currently possible to name an Opam switch "-".

@rjbou rjbou added this to To do in Feature Wish via automation May 31, 2021
@AltGr
Copy link
Member

AltGr commented Jun 10, 2021

Indeed that could be convenient, it just means we would need to store a list of previously selected switches in the config.

For now, and for simple commands I'd just use --switch plugin-host for the intermediate commands :)

@dra27 dra27 added this to To do in Opam 2.2.0 via automation Jul 2, 2021
@dra27 dra27 removed this from To do in Feature Wish Jul 2, 2021
@dra27 dra27 added the AREA: UI label Jul 16, 2021
@kit-ty-kate kit-ty-kate linked a pull request Nov 13, 2021 that will close this issue
@rjbou rjbou moved this from To do to In progress in Opam 2.2.0 Nov 24, 2021
Opam 2.2.0 automation moved this from In progress to Done Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Opam 2.2.0
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants