-
Notifications
You must be signed in to change notification settings - Fork 780
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
The list rbenv install -l
is too long, show latest stable releases by default
#1402
Conversation
when showing available versions
I'll fix CI test later. |
008d844
to
4577be8
Compare
Hi, thank you for the idea! I definitely agree that it's problematic that the list grows indefinitely and that it starts with all the EOL'd versions and you need to scroll a bunch to get to the recent ones. However, I'm not convinced that the solution proposed here is the right one. I just don't see myself, or anyone else, routinely passsing the different How could we make the list by default look nicer? Could we perhaps start with the latest Ruby version and go down to the oldest? That way people don't have to scroll when listing available versions. |
I think it would be nicer to only show each stable version for each interpreter.
The data it uses is from https://github.com/postmodern/ruby-versions which is easy to consume. I would think most Having a full list somewhere is maybe still useful in some cases, but seems rather unhelpful in most cases, especially when it's so long. The short list could be shown just on |
Since we'd probably want to compute the short list from the full list of definitions, maybe we could simply group by "development branch" which is "major.minor" for MRI and just "major" for other rubies, and show the latest of each such group. |
@eregon I like these suggestions! I wonder to which level should we keep backwards compatibility with |
Re compatibility, I think I think changing |
Thanks, I'll make a change. |
As suggested by @eregon, now we have "-l/--list" option for the short list of versions. Behaviour of `ruby-build --definitions` is kept as before for compatibility. rbenv-install: -L/--list-all full list -l/--list short list ruby-build: -d/--definitions full list -l/--list short list
Done. One more change is remained that not to show |
Thought: what if EOL versions of ruby were extracted out of this repo into a separate repo? rbenv will pull definitions from all plugins (matching the Users who need to install EOL versions would just need to clone the other plugin repo. Everyone else, by default, would have the more manageable list of versions. |
@metalefty The current state of the PR seems to only exclude EOL versions, that's still a very long list. What do you think of having an output similar to what I mentioned in #1402 (comment) ? I think |
Thanks for the feedback. Regarding showing the latest stable releases, I think it is a good idea but at least I'm not very interested in that. The biggest thing I wanted to do is do not show ancient Rubies such as 1.8, 1.9. It's not worth the effort for me. If someone else implement that feature, I welcome his/her contribution. I will not disagree. |
Removed |
@metalefty Could you post the full list before and after in a gist? I think an output like @mislav What do you think? |
To show only the latest stable releases, some tags need to be added in definition files to indicate the version is a latest stable release. Like It is not difficult and I'm OK with implementing filtering list using such tags. However, it makes complicated to maintain definitions. When a new version released ( |
Thanks, that goes from 463 lines to 150 lines. A good improvement, but still quite long and requires a lot of scrolling. Probably very few are interested e.g. in the full list of 100+ releases of rbx-3.x. Note that MRI 2.4 is not EOL yet. It will be soon, but I think we shouldn't exclude
My idea to implement that is to not to use a tag (that causes conflicts and is hard to maintain, indeed) but to only use the filename of each definition. From there we can find which Ruby implementation it is and the version by splitting around the first |
Sounds good. I'm close to implementing it. |
@eregon I finally got the short list like the following. Does this satisfy you?
ADDED: If you want to include MRI 2.4.9, I'll make an additional change. It's a piece of cake. |
@metalefty Nice! I wonder if we should add a note to the output saying: "To see all available versions, use --list-all", or something like that. |
I agree to add that user-friendly note. The message should be on stderr not to break machine parsability. |
Resolved conflicts. |
b655567
to
e2b65f5
Compare
Merge? |
@mislav Could you merge this PR? I think it's ready. |
Can you consider a timeout for @mislav ? 2 months have already past since the last time he gave me feedback. I would say 2 months are enough to wait him back. I don't think we need to wait for him anymore. |
I agree, I think 2 approvals is enough for this, and it can always be refined later, let's merge. |
Released as https://github.com/rbenv/ruby-build/releases/tag/v20200518 It works well for me locally. |
README: reflect changes in rbenv/ruby-build#1402
`rbnenv instal -l` shows the available versions, already in default. See also: - rbenv/ruby-build@12b17e6 - rbenv/ruby-build#1402 - http://w.vmeta.jp/tdiary/20200519.html
Use `rbenv-install --list-all` (see rbenv/ruby-build#1402 why --list-all and not --list) instead of `ruby-build --definitions`.
* commit 'rbenv-tags/v1.2.0': rbenv 1.2.0 Clarify bash config for Ubuntu Desktop vs. other platforms 💅 Clean up version sorting and add test Sort versions semantically in rbenv versions Have shims survive symlinked rbenv updates a la Homebrew GitHub now auto-generates a Table of Contents Speed up rehash Have `rbenv init` print instructions that hardcode the detected shell Supply `head -n` flag explicitly Update rbenv-doctor link master -> main Updated rbenv-doctor url to reflect renaming master branch to main Fix link to rbenv-doctor test(init): remove misleading arg in detect from parent shell case feat(init): strip -<suffix> when autodetecting shell [DOCS] Typo and formatting fix. Use a better PS4 as recommeneded by Bash Hackers Wiki Update README.md README: reflect changes in rbenv/ruby-build#1402 Rename CONDUCT.md to CODE_OF_CONDUCT.md bash completion: avoid unintentional globbing Make work in set -u (nounset) mode Spelling fix Remove agignore Fix fish instructions test Remove another `fish` psub usage Fix fish shell initialization Use `actions/checkout` v2 Run CI for pull requests from forks Re-add zsh completion script and remove fish completion script Remove fish completion script Fix (revert) test/version-origin.bats libexec/rbenv-version{,-origin}: move "missing rbenv-version-file detection" logic as per @mislav Fix tests for #1203 libexec/rbenv-version{,-origin}: fix earlier commit to allow for RBENV_VERSION env var libexec/rbenv-version: get rid of misleading "set by $(rbenv-version-origin)" message when system ruby is in use test/run: handle optional paths/args for bats Documentation unclear
* commit 'rbenv-tags/v1.2.0': rbenv 1.2.0 Clarify bash config for Ubuntu Desktop vs. other platforms 💅 Clean up version sorting and add test Sort versions semantically in rbenv versions Have shims survive symlinked rbenv updates a la Homebrew GitHub now auto-generates a Table of Contents Speed up rehash Have `rbenv init` print instructions that hardcode the detected shell Supply `head -n` flag explicitly Update rbenv-doctor link master -> main Updated rbenv-doctor url to reflect renaming master branch to main Fix link to rbenv-doctor test(init): remove misleading arg in detect from parent shell case feat(init): strip -<suffix> when autodetecting shell [DOCS] Typo and formatting fix. Use a better PS4 as recommeneded by Bash Hackers Wiki Update README.md README: reflect changes in rbenv/ruby-build#1402 Rename CONDUCT.md to CODE_OF_CONDUCT.md bash completion: avoid unintentional globbing Make work in set -u (nounset) mode Spelling fix Remove agignore Fix fish instructions test Remove another `fish` psub usage Fix fish shell initialization Use `actions/checkout` v2 Run CI for pull requests from forks Re-add zsh completion script and remove fish completion script Remove fish completion script Fix (revert) test/version-origin.bats libexec/rbenv-version{,-origin}: move "missing rbenv-version-file detection" logic as per @mislav Fix tests for #1203 libexec/rbenv-version{,-origin}: fix earlier commit to allow for RBENV_VERSION env var libexec/rbenv-version: get rid of misleading "set by $(rbenv-version-origin)" message when system ruby is in use test/run: handle optional paths/args for bats Documentation unclear
Background
As time passes, list of available ruby versions is growing. However, I think ordinary users hardly install ancient versions such as Ruby 1.8 and Ruby 1.9. Now
rbenv install -l
became too big and is filled up with obsolete unused versions.What I did
I implemented new options to show only supported versions.
rbenv install -L (--list-exclude-eol)
ruby-build --definitions-exclude-eol
I used
warn_eol
warn_unsupported
flag to determine if the version is EoL'ed.Result
Now I get significantly compact list.
Also I can easily know which versions are supported. I believe this feature is helpful for most users.