jesseduffield / jesseduffield/lazygit
New "notARepository" strategy: recurse
- 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.**
I often work with clusters of related repos:
```
.
├── project1
│ ├── repo1
│ └── repo2
└── project2
├── repo1
├── repo2
└── repo3
```
I'd like to just pop up a terminal, cd to the `projectN` folder I'm interested in, start `lazygit` and have the "recent repos" list contain all and only the repos under this subtree. Seeing repos from other projects is confusing in this case, as only that specific subset is of interest at the moment. Also, repos I've never opened with `lazygit` should also appear, (ex. right after cloning a bunch of them).
**Describe the solution you'd like**
The `notARepository` configuration item could get a new family of values: `recurse:N`, where N defines the maximum depth we are going to look for repos. Under such setting, when `lazygit` is opened in a non-repo folder, it will scan the cwd subtree (up to the specified depth) and gather all git repos found. After that, the "recent repos" popup will show such list for this session, allowing to easily switch between repos.
When opening a repo folder, things would work as usual. Also, repos selected from the scan list would go into the recent list as usual and persist in the state file.
**Describe alternatives you've considered**
Custom commands don't seem to cut it, as this would need to change the state of `lazygit` itself, and from a shell command I could only spawn a new instance and kill the old. And this would also be platform-specific.
**Additional context**
This could be an alternative to #3782. It would show all repos that were available when `lazygit` was started. To get the new ones, just close and reopen (or maybe this could be added to some refresh command?).
I could work on this item myself if maintainers are interested, as this is a feature I'd love to see in `lazygit`.
Contributor guide
Assessment
This issue has not been assessed yet.