choco icon indicating copy to clipboard operation
choco copied to clipboard

(#256) Add `order-by` parameter and sort packages by name by default

Open bartvanandel opened this issue 7 years ago • 20 comments
trafficstars

This change adds a new command line option "order-by", allowing the user to specify a few sorting strategies. By default the results will be sorted by name.

Fixes #256

Note that some results may appear out-of-order, this is caused by the NuGet server returning them in the incorrect order, see https://github.com/chocolatey/NuGet.Server-chocolatey/issues/2

bartvanandel avatar Jul 20 '18 20:07 bartvanandel

Minor nitpick, the git commit body (the message) needs to split at 72/80 characters as well.

ferventcoder avatar Jan 18 '19 01:01 ferventcoder

Minor nitpick, the git commit body (the message) needs to split at 72/80 characters as well.

Do you want 72 or 80?

bartvanandel avatar Jan 18 '19 11:01 bartvanandel

72 is what CONTRIBUTING states - https://github.com/chocolatey/choco/blob/master/CONTRIBUTING.md#prepare-commits

ferventcoder avatar Jan 18 '19 13:01 ferventcoder

Wrapped commit body at 72 chars as requested.

bartvanandel avatar Jan 20 '19 22:01 bartvanandel

Just pushed a change to satisfy AppVeyor. Unfortunately Travis crashed before compilation even started. Anyway, any other changes you require before you decide to merge this pull request?

bartvanandel avatar Jan 28 '19 18:01 bartvanandel

@ferventcoder I put some effort into this branch 22 to 15 months ago, you requested some changes which I resolved back then, but after that, silence... I can try to rebase this onto current master (or merge master into this branch, which seems reasonable enough to me, you can squash merge anyway), but are you going to try and merge it after I do? The issue is still open so I assume it's still not fixed, but I don't feel like putting effort into this and being neglected again.

bartvanandel avatar May 01 '20 18:05 bartvanandel

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 08 '20 14:06 CLAassistant

Weird. Codacy says there are 2 new issues, but when diving into the details by following the links you end up not seeing them in code. Also, Travis fails with an internal error, I don't think I can fix that. @ferventcoder can you see what's going on?

bartvanandel avatar Jun 09 '20 12:06 bartvanandel

@bartvanandel Yes, these are good changes. You can rebase or we can manage the rebase for you. I would say ignore Codacy at this point. I think Travis is likely failing here due to the merge conflict as it is trying to build/run it as if it is merged in.

ferventcoder avatar Jun 10 '20 04:06 ferventcoder

Well, happy to contribute! I think it's probably fastest if you do the rebase, as you know better about what has changed than I do (I basically don't have a clue at this point ;-) and you can merge directly when it's done.

bartvanandel avatar Jun 10 '20 10:06 bartvanandel

@ferventcoder any progress on this PR?

bartvanandel avatar Jul 13 '20 20:07 bartvanandel

@ferventcoder hello?

bartvanandel avatar Jul 25 '20 19:07 bartvanandel

@ferventcoder Are you going to resolve the merge conflicts and merge this branch at some point? This PR is over 2 years old and still applies. I put some effort into it, so it would be nice to see the results in a released version of the product at some point...

bartvanandel avatar Aug 15 '20 12:08 bartvanandel

BTW I don't think your earlier reviews apply anymore, those were resolved a year and a half ago, but due to rewritten history (as requested, because of the rebase) the commits that were reviewed cannot be found anymore. Basically the review is currently a dead-end street.

bartvanandel avatar Aug 15 '20 12:08 bartvanandel

@ferventcoder Any chance this PR is ever going to be merged? I just ran choco search screen and I'm still annoyed by the apparent lack of order in the 241 results long output. The PR is now over 2 years old...

BTW I suggest that you take a look at any merge conflicts, I've resolved them in the past but I don't feel like resolving them again only to see the PR still not being merged.

bartvanandel avatar Mar 25 '21 11:03 bartvanandel

@gep13 Are you the new maintainer? Would you be willing to finish up and merge this long-standing pull request?

bartvanandel avatar May 10 '21 21:05 bartvanandel

I give up. For more than 3 I've tried to get this PR reviewed and merged, but @ferventcoder doesn't seem interested enough.

bartvanandel avatar Sep 22 '21 10:09 bartvanandel

We will also need to look at deprecating the --order-by-popularity option, as this is essentially duplicated by --order-by="popularity"

gep13 avatar May 15 '25 14:05 gep13

We will also need to look at deprecating the --order-by-popularity option, as this is essentially duplicated by --order-by="popularity"

Makes sense I guess.

If you don't mind, I won't be making any more changes. This PR is almost 7 years old and was essentially ignored for the past 5 years. I rebased once or twice on request, only to be left out in the cold again.

You're more than welcome to continue working on this branch though.

FWIW, the string "Available in 0.10.12+" is no longer valid either.

bartvanandel avatar May 15 '25 14:05 bartvanandel

@bartvanandel completely understood. Thank you again for getting this PR started, and apologies for the length of time taken.

The wheels turn slowly, but they do turn! 😄

gep13 avatar May 15 '25 17:05 gep13

I have taken the liberty to update this PR to be compatible with the latest version of Chocolatey CLI, and rebased/retargeted it against develop.

AdmiringWorm avatar Jun 19 '25 13:06 AdmiringWorm

I have updated the PR again, taking out the aliases and its related EnumExtension helper (I will move this to a different branch so we have a reference to it if needed in the future).

I have also wrapped all error and warning messages on column 80 as we discussed during our chat, and removed the prefixed Warning and Error since we aren't using that elsewhere in the codebase.

Add some more unit tests for the private methods that were added...

AdmiringWorm avatar Jun 20 '25 13:06 AdmiringWorm

@bartvanandel thanks again for getting this PR started, we really appreicate it!

Once the CI builds are complete here, I am going to get this merged, and this will be shipping as part of Chocolatey CLI 2.5.0.

gep13 avatar Jun 20 '25 16:06 gep13

Removing this from the 2.5.0 milestone, since the issue associated with it has been added to the milestone.

gep13 avatar Jul 01 '25 13:07 gep13