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

[Search History][Search Git Log] use history scoring scheme #302

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

t-nil
Copy link
Contributor

@t-nil t-nil commented Jul 31, 2023

This improves ranking by using age not only as tiebreaker, but giving it more weight. I for example have some commands which I use almost daily but which always appear third or even lower in the list, due to some other commands (which I didn't use for months) matching a little bit better.

From the man page:

     --scheme=SCHEME
             Choose scoring scheme tailored for different types of input.

             default  Generic scoring scheme designed to work well with any type of input
             path     Scoring scheme for paths (additional bonus point only after path separator)
             history  Scoring scheme for command history (no additional bonus points).
                      Sets --tiebreak=index as well.

use --scheme=history instead of --tiebreak=index
@PatrickF1
Copy link
Owner

Hi Florian, YESSS I was looking into this when the history scheme came out but I never got around to this. This is a change I want to make. Two things

  1. can you explain how this "Scoring scheme for command history (no additional bonus points)." means that more recent entries will have more weight?
  2. can you make the change for git log too, please?

@PatrickF1 PatrickF1 changed the title history: use --scheme=history instead of --tiebreak=index [Search History][Search Git Log] use history scoring scheme Aug 14, 2023
@PatrickF1 PatrickF1 merged commit 6d00ecc into PatrickF1:main Aug 14, 2023
@xconverge
Copy link

@PatrickF1 this broke my system for some reason

I suspect the version of fzf in the repo for ubuntu is too old to support this

I get unknown option: --scheme=history flashing really quickly when I do ctrl+r

Ubuntu 22.04 (LTS) is on fzf 0.29

I will try updating fzf manually I suppose

@xconverge
Copy link

Yes building/installing fzf from source worked, but I do want you to be aware, it would have been nice to have this only apply in the wrapper if it was supported by the version

@PatrickF1
Copy link
Owner

Oops my bad, yeah I forgot to bump the minimum fzf version and then I should have made this a major release. Thanks for the FYI

PatrickF1 added a commit that referenced this pull request Aug 21, 2023
In #302, I forgot that --scheme is a relatively new option for fzf.
I should have also made a fzf.fish major release. My bad!
Sorry to all Ubuntu users stuck on 0.29.

Also shortened the readme a bit.
@t-nil t-nil deleted the patch-1 branch September 1, 2023 11:32
@t-nil
Copy link
Contributor Author

t-nil commented Sep 1, 2023

Hi Florian, YESSS I was looking into this when the history scheme came out but I never got around to this. This is a change I want to make. Two things

  1. can you explain how this "Scoring scheme for command history (no additional bonus points)." means that more recent entries will have more weight?
  2. can you make the change for git log too, please?

Hey Patrick,
sorry, I am only erratically active on github. At that time I didn't find out anything else except that the scheme seemed to work for my history search.
Thanks alot for taking the time, specifically fixing this and investigating on fzf Issues, and in general for maintaining this very useful set of scripts :)

@PatrickF1 PatrickF1 mentioned this pull request Nov 11, 2023
4 tasks
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