juliaup icon indicating copy to clipboard operation
juliaup copied to clipboard

Alternate short channel matching support

Open christiangnrd opened this issue 1 year ago • 6 comments

Closes #836 and closes #830.

If the channel is the prefix for one and only one installed channel, use that, otherwise old behaviour. This behaves more like the julia command line arguments

Should work with any installed channel including linked channels instead of a hard-coded few.

christiangnrd avatar Feb 14 '24 17:02 christiangnrd

I don't like this because I could have Julia 1.6.2 as the only installed version and then run julia +1 and get that version. Similarly, I could have Julia 1.10 installed and run julia +1.1 and get version 1.10 instead.

The reasons this short matching works okay in Julia (and some other programs') command matching is that

  • Their options are intelligently named to avoid misleading prefixing
  • Their options are words or phrases that have a more diverse prefix set than version numbers

Whereas in this use case,

  • Juliaup's set of version options varies depending on the installation (if we are filtering to installed channels)
  • Juliaup's option names are already very concise so the benefit is less.

LilithHafner avatar Jul 03 '24 15:07 LilithHafner

I've updated to not match on version numbers. The approach feels hacky but also I don't know if it needs to be more complicated.

Unfortunately the new tests end up downloading 2 extra Julia versions so that might take up a lot more time. Maybe I should test with channels linked to already downloaded versions?

christiangnrd avatar Jul 03 '24 19:07 christiangnrd

@LilithHafner Thank you very much for your review! I've addressed your feedback and implemented all your suggestions.

Regarding this PR or #836, I wrote this because I sometimes write more than just the first letter, and I want this feature to work with linked channels. Also, for someone like me who sometimes tries out PRs but rarely more than one at a time, once #903 is a thing, it'll be nice to be able to call julia +pr instead of having to remember the pull request number.

christiangnrd avatar Jul 03 '24 23:07 christiangnrd

@rakeshksr @christiangnrd and espeically @davidanthoff, could we discuss which option we prefer (#838 vs #836) both are imo ready to merge but we need to pick which.

LilithHafner avatar Jul 04 '24 19:07 LilithHafner

My justification for preferring this approach is in my previous comment. To add to that, I always have a dev channel linked to my local branch of Julia, I feel like it would be quite unintuitive to have +b work for beta, and +l work for lts, but +d error out for dev.

christiangnrd avatar Aug 05 '24 03:08 christiangnrd

I think I've finally am getting clarity what I'm thinking about this, see https://github.com/JuliaLang/juliaup/issues/830.

davidanthoff avatar Oct 06 '24 01:10 davidanthoff