-
Notifications
You must be signed in to change notification settings - Fork 365
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
Add support for "opam switch -" (go to previous switch) #4910
Conversation
15f1d2b
to
4388c43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Some modifications suggested, and some doc missing (manpage, website).
Also, should we add an format upgrade function to convert already present switches named -
, in case they exist? Or we can assume that they don't exist (it wasn't forbidden, so it can exist).
abf9641
to
47c7928
Compare
All done. The switch name I’m still trying to figure out the manpage/doc situation but other than that this should be ready |
On non avoiding |
is the new manpage entry clear enough? |
It is clear, i wrote the comment before you last push :) |
ec5c8a7
to
abece9c
Compare
d652baf
to
c141311
Compare
We need to check for opam root, but otherwise, lgtm! |
2688441
to
022a7a1
Compare
I need to rework the opam root test first, to make it no opamroot bump specific |
that correspondance was already not there (which is why |
LGTM; I can suggest an idea to avoid having to bump the format though: order the |
842075d
to
ac19c21
Compare
Couldn't resist and tried an implementation :) |
9b22b95
to
bd5da14
Compare
68635ee
to
7ff0567
Compare
Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
Use ordering of installed-switches instead of a new field This avoids bumping the file version. There are small differences in semantics though, as shown in the tests: - after switching twice to the same switch, `opam switch -` now still gets you to the one before that - it gets you to the 'last-known-good' switch, even if the last one was removed I would argue that this new behaviour is ok, if not better. Add a specific error in case the previous switch no longer exists Co-authored-by: Louis Gesbert <louis.gesbert@ocamlpro.com> Co-authored-by: R. Boujbel <rjbou@ocamlpro.com>
Check that switches with name "-" do not interfere with the "go to previous switch" feature reftests: add in switch-set some previous switch log, local switch and removed switch tests
This implements #4688 with the same behaviour as
git switch -
cc @craigfe