-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fuzzy search for branches, both local branches and remote branches #2057
Comments
Was this marked as |
I'd love to see this reopened! The current non-fuzzy search through remote branches (e.g. when I'm reviewing a PR with a branch name I half remember) doesn't let me be as lazy as I could be if that list gradually narrowed as I type the parts of the branch name I'm confident about (i.e. what happens when you search your combined local/remote branch list in VS Code). |
@mark2185 @ooloth I closed this manually, as I quickly discovered this functionality was already implemented. At least to the degree I desired. When I'm in the tab branches, I can simply use Do you agree that the functionality is sufficiently implemented, or is something lacking? |
It's sufficient for my needs, but @ooloth seems to have different use cases, but I think that calls for a different issue/feature request. I'm only asking because the issue was opened and then closed 2 minutes after without any explanation so I presumed it might have been a misclick or something. If you're happy with the current implementation, there's no need to do anything else. |
I discovered that what I'm asking for is in a WIP stage in PR #1993 (the development of which was live-streamed in this video and this video). @magnusrodseth When I'm in the branches area and press That's great, but fuzzy search with filtering would be even lazier (like fuzzy finding git branches in the VS Code command palette or any list using |
@ooloth Sounds good. As I have already written out the desired feature, I'd be happy to re-open this issue, and then someone can work on it 😁 |
Apologies for not having made much progress on that WIP in a while. There were some tricky kinks to iron out. I've got a PR on lazydocker (jesseduffield/lazydocker#392) that's close to being merged and my plan is to take the lessons learned from that and apply them in the WIP lazygit PR |
Although come to think of it, the tricky parts all related to the commits panel. If there isn't a strong use case for fuzzy-searching on the commits panel we could do that as a separate thing later |
@jesseduffield No apology needed! These “lazy” tools are great. For me, searching through local and remote branches is something I do daily (while reviewing PRs), while searching through commits is something I’ve never done. So launching the feature without commits panel support for now would work for me. |
@jesseduffield I can +1 on exactly what @ooloth said. Fuzzy searching in branches is a daily thing for me, but I have never had the need to fuzzy-search through commits. |
@jesseduffield Apologies! I just discovered Sorry I missed that! As far as I'm concerned, that satisfies the feature request described in this issue. Ongoing thanks for |
Hmm...I just noticed that we can't use Not sure which improvement is quicker and easier to add, but I guess there still isn't a single workflow that allows both fuzzy searching branches and checking them out as local branches. I wish I knew Go so I could help by opening a PR. 🙃 |
@ooloth This could be a temporary workaround for the time being. customCommands:
- key: 'C'
context: 'localBranches'
command: 'git switch -c $(echo {{ .Form.Branch }} | sed "s/\(.*\/\)\(.*\/\)\(.*\)/\2\3/") {{.Form.Branch }}'
description: 'Checkout remote branch by name with fuzzy searching'
prompts:
- type: 'input'
title: 'Which branch?'
key: 'Branch'
suggestions:
preset: 'remoteBranches' |
In the latest release (v0.39.2) we now have exact filtering in the branches panel. But if you want fuzzy filtering, that's added by #2808 (so you'll need to build lazygit from the master branch) |
@magnusrodseth can you let me know if your issue is now resolved? |
I am very happy with the current search functionality, so for me, there's no need to keep this open anymore |
Is your feature request related to a problem? Please describe.
I find myself using quite a lot of time step-by-step iterating through all living remote branches when working in a larger team.
Describe the solution you'd like
I would like to search for branches using fuzzy search. Personally, this is most useful for me regarding remote branches, but I imagine the implementation for local branches is trivial to support after implementing remote branch fuzzy search.
For instance, I want to checkout the remote branch
bug/100/fix-something
. I want to search when inside the tab for remote branch using/
or something, and execute a fuzzy search this way. Typingbug
would show me all branches with the stringbug
in them.EDIT
After some discussion (see thread), the issue has been re-opened, because this fuzzy-search functionality is not yet implemented. For instance, if I want to find
bug/100/fix-something
, I'd like to for instance writebugthing
. Although this may not be a realistic search, it illustrates the desired fuzzy search functionality. Like @ooloth stated, it would act likefzf
orTelescope
in Neovim.Describe alternatives you've considered
The current alternative is nothing. Rather, I manually iterate through all remote branches until I find what I'm looking for.
The text was updated successfully, but these errors were encountered: