Fix incorrect fzf minimum-version comparison#1030
Open
shaked-shlomo wants to merge 1 commit into
Open
Conversation
The minimum supported fzf version is 0.23.1, but the guard required major == 0 && minor < 23 && patch < 1 (all with &&). Because patch < 1 is only true for patch == 0, versions such as 0.22.5 and 0.23.0 — both older than 0.23.1 — were not detected as too old, while only x.y.0 versions were. Compare the (major, minor, patch) tuples directly so any version below the minimum is correctly flagged.
|
Thanks for opening this pull request! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The minimum supported fzf version is
0.23.1(MIN_FZF_VERSION_*), but the check insrc/finder/mod.rsANDs the three components independently:patch < 1is only true whenpatch == 0, so the warning fires for the wrong set of versions:So users on common too-old versions like
0.22.x(x≥1) or0.23.0silently skip the warning, while only*.*.0versions are caught.Fix
Compare the version tuples lexicographically (Rust tuples already implement
Ordthis way), which correctly flags any version below the minimum:No behavior change for versions ≥ 0.23.1; it only fixes the missed older versions.