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

Hidden re-ordering of packages passed to opam show #4163

Closed
craigfe opened this issue Apr 29, 2020 · 3 comments · Fixed by #4179
Closed

Hidden re-ordering of packages passed to opam show #4163

craigfe opened this issue Apr 29, 2020 · 3 comments · Fixed by #4179
Milestone

Comments

@craigfe
Copy link

craigfe commented Apr 29, 2020

When invoking opam show with multiple packages, the results are reported in alphabetical order of package name. This is fine (if a bit odd) when all of the metadata is displayed, but is a bit pernicious when used in combination with the --field option:

ᐅ opam show --field=version -- irmin ocamlformat alcotest
1.1.0
2.1.0
0.14.1

(Here the versions are in the order alcotest, irmin, ocamlformat, but this is non-obvious.)

I would expect the result order to be the same as the order of options passed to opam show. Failing that, the manpage for opam show should probably indicate that results given out-of-order.

@rjbou
Copy link
Collaborator

rjbou commented May 1, 2020

Internally, opam reorder, but I don't know if it the intended behavior since the beginning or a side-effect.
@samoht @dbuenzli how do you handle that in your scripts?

@samoht
Copy link
Member

samoht commented May 3, 2020

I don't think any of my script is relying on that order.

@avsm
Copy link
Member

avsm commented May 5, 2020

I've typically passed --field=name,version and parsed the output. I agree that preserving the input order would minimise surprise.

@rjbou rjbou added this to the 2.1.0~beta milestone May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants