jesseduffield / jesseduffield/lazygit
Ignored files list view, and ability to "unexclude" files
- 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.
_Please see related discussion #5840._
Currently from the Files panel, we can ignore (``) the file in two ways:
1. add file to `.gitignore` (``)
2. add file to the `.git/info/exclude` (``)
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 (``), 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 (``), and then return to Lazygit after exiting the editor.
### Describe alternatives you've considered
- for viewing the ignored file + ignore source, as suggested in #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.
Contributor guide
Research direction
Read the related discussion in #5840 and review Lazygit's existing Files-panel ignore actions, including the custom-command alternative mentioned here. Determine how ignored files and their gitignore or exclude sources should be represented, and how editing those files should return to Lazygit. Done means the requested listing and unexclude workflow are defined and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, go
- Domain
- cli, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100