Skip to content

Git-based Commit log search #3279

@jesseduffield

Description

@jesseduffield

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

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

image

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions