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

pod search should list versions in version order, not lexicographic order #1936

Closed
RepublicOfAppsLLC opened this issue Mar 28, 2014 · 2 comments · Fixed by CocoaPods/Core#111
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!

Comments

@RepublicOfAppsLLC
Copy link

Try

shell> pod search
-> Facebook-iOS-SDK (3.13.0)
   The iOS SDK provides Facebook Platform support for iOS apps.
   pod 'Facebook-iOS-SDK', '~> 3.13.0'
   - Homepage: https://developers.facebook.com/docs/ios/
   - Source:   https://github.com/facebook/facebook-ios-sdk.git
   - Versions: 3.9.0, 3.8.0, 3.7.1, 3.7.0, 3.6.0, 3.5.3, 3.5.2, 3.5.1, 3.5.0, 3.2.1, 3.2.0, 3.13.0, 3.12.0, 3.11.1, 3.11.0, 3.10.0, 3.1.1, 3.1.0, 3.0.8, 3.0.7, 3.0.6.b, 3.0.5.b, 1.last, 1.2, 0.0.1 [master repo]

Note how the leftmost version listed in the Versions line is 3.9.0 when in fact the latest version is actually 3.13.0.

A human is going to look at the Versions line and assume the most recent version is on the left. Nobody is going to assume that they need nor wlll they want to scan the whole line and pick out the latest version.

I realize that the latest version is shown in parentheses in the top title of the podspec listing

-> Facebook-iOS-SDK (3.13.0)

However, it seems like listing the Versions line in lexicographic order is a bug and makes no sense since the natural and correct way to think about versions is by their actual domain ordering, which would place versions in a strict ordering from, preferably, latest on the left to oldest on the right.

I'd be happy to take a look at fixing this if you can give me a pointer where to look in the code.

Thanks!

Joel

@fabiopelosin
Copy link
Member

👍

The approximative stack trace is the following:

Another place where this issue should be fixed is:

According to the documentation versions are represented in the Pod::Version class which should take care of properly setting the sorting behaviour:

If you submit a patch please update the changelog crediting yourself and mentioning this issue and provide adequate testing... feel free to ask if you need any clarification.

@CocoaPodsBot
Copy link

Issue has been confirmed by @neonichu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants