jesseduffield / jesseduffield/lazygit

Git-based Commit log search

Open
#3,279 4 comments 38 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Is your feature request related to a problem? Please describe.**
There are currently two ways to search the commits view:
1) text-based search via '/', which allows you to search based on the commit hash or commit message summary (i.e. whatever is visible in the view)
2) searching by file path

I want a more comprehensive search feature that allows searching by:
* commit message (whole commit message, not just the summary)
* author
* file path
* file diff content

I also want to be able to specify whether I want to search within the whole repo or just the current branch (similar to Fork):

![image](https://github.com/jesseduffield/lazygit/assets/8456633/f377b066-b184-4387-9ff7-c583ee0ee955)

**Describe the solution you'd like**
I don't have a proposal for a design: I think it's worth looking at how various other git GUIs support search and then choose a design that we think works best for lazygit. Notably, I like gitui's approach where you can search and specify what you want to search within and then it shows the results in context, with non-matches greyed out (and your cursor skips over those when navigating)

![image](https://github.com/jesseduffield/lazygit/assets/8456633/65cf84e4-5abc-41aa-831e-f1f38cc9c6e5)

![image](https://github.com/jesseduffield/lazygit/assets/8456633/1d05f490-02ae-478b-b866-8d691d49cdaa)

In Fork, you only specify a single attribute to search by (e.g. author, message) and results are shown in a side view, and if you click on one, it selects the corresponding item in the main graph view

![image](https://github.com/jesseduffield/lazygit/assets/8456633/d0e4de53-4a5b-420e-ad5b-5e1a0b7c0f01)

I think gitui's approach makes more sense for lazygit which doesn't have a main graph view like many git GUIs do. We could add a keybinding for whether we show the greyed out non-matching commits or not.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.