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

Sort versions in status output in natural order. #724

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

GunnarFarneback
Copy link
Contributor

Use natural sort comparison to list versions in the expected order.

Before:

$ juliaup status
 Default  Channel  Version                       Update                                           
--------------------------------------------------------------------------------------------------
          0.6      0.6.4+0.x64.linux.gnu                                                          
          1.10     1.10.0-beta1+0.x64.linux.gnu  Update to 1.10.0-beta2+0.x64.linux.gnu available 
          1.6      1.6.7+0.x64.linux.gnu                                                          
          1.6.7    1.6.7+0.x64.linux.gnu                                                          
          1.7      1.7.3+0.x64.linux.gnu                                                          
          1.8      1.8.5+0.x64.linux.gnu                                                          
          1.9      1.9.2+0.x64.linux.gnu         Update to 1.9.3+0.x64.linux.gnu available        
       *  release  1.9.2+0.x64.linux.gnu         Update to 1.9.3+0.x64.linux.gnu available        

After:

$ juliaup status
 Default  Channel  Version                       Update                                           
--------------------------------------------------------------------------------------------------
          0.6      0.6.4+0.x64.linux.gnu                                                          
          1.6      1.6.7+0.x64.linux.gnu                                                          
          1.6.7    1.6.7+0.x64.linux.gnu                                                          
          1.7      1.7.3+0.x64.linux.gnu                                                          
          1.8      1.8.5+0.x64.linux.gnu                                                          
          1.9      1.9.2+0.x64.linux.gnu         Update to 1.9.3+0.x64.linux.gnu available        
          1.10     1.10.0-beta1+0.x64.linux.gnu  Update to 1.10.0-beta2+0.x64.linux.gnu available 
       *  release  1.9.2+0.x64.linux.gnu         Update to 1.9.3+0.x64.linux.gnu available       

@LilithHafner
Copy link
Member

See also: #685

While we're at it, we might as well also human sort the juliaup override status list

.sorted_by_key(|i| i.path.to_string())

@GunnarFarneback
Copy link
Contributor Author

I was looking at that sort as well but I have never used overrides and haven't even investigated what they are good for, so my list was empty, making it difficult to verify that a sorting change is effective or meaningful at all.

@StefanKarpinski
Copy link
Member

I'm also not clear on whether it's a good idea to natural sort paths. Natural sorting version names is a clear winner, so lets go ahead with that and we can open an issue for natural sorting of paths.

@LilithHafner LilithHafner merged commit 6f6dce8 into JuliaLang:main Sep 6, 2023
23 checks passed
@GunnarFarneback GunnarFarneback deleted the natural_sort_versions branch September 6, 2023 19:08
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 this pull request may close these issues.

3 participants