Skip to content

Ignored files list view, and ability to "unexclude" files #5880

Description

@AndrewStopchenko-SO

Is your feature request related to a problem? Please describe.

Please see related discussion #5840.

Currently from the Files panel, we can ignore (<i>) the file in two ways:

  1. add file to .gitignore (<i>)
  2. add file to the .git/info/exclude (<e>)

For option1, .gitignore files are usually tracked in the project, and thus ignoring the file, we see the .gitignore as modified. Also, .gitignore is the natural "go-to" when looking for the currently ignored patterns.

But with option2, that .git/info/exclude file is stored inside the internal Git's folder - to be honest, I found out about that additional ignore file only thanks to the Lazygit!
Another problem is that, since that file is somewhere inside the .git/ folder's inners, it is easy to miss that extra place when searching for ignored patterns.

As a result, after the file is excluded (<i><e>), it becomes nontrivial to "unexclude" it.

Describe the solution you'd like

  • It would be nice to have a view with a listing of currently ignored files and/or patterns.
    • If that listing of ignored files could also reveal the "ignore source" (gitignore vs exclude), that would be wonderful.
  • It would be super-helpful if we could have a keybinding that allows editing the .gitignore or .git/info/exclude ignore files, respectively; I imagine something similar to how we currently edit the conflicted files (<e>), and then return to Lazygit after exiting the editor.

Describe alternatives you've considered

  • for viewing the ignored file + ignore source, as suggested in Seeing the ignored files list / "unignore" #5840: git ls-files --others --ignored --exclude-standard | git check-ignore --stdin -v
  • It seems like custom commands might be added to open this or that ignore file? Not sure, I did not create custom Lazygit commands before.

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