feat: look for repos in the usual folders, not just ~/git (#57)

Without roots in the config, repos are found under whichever of ~/git,
~/repo, ~/repos, ~/projects, ~/code, ~/source and ~/src exist. Missing
ones cost a stat each. A root that's a symlink to another is scanned
once, and a repo under two roots keeps the first one's name.

Reviewed-on: #57
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
This commit was merged in pull request #57.
This commit is contained in:
keb authored and Karl-Einar Bergstrøm committed 2026-10-13 15:37:55 +02:00
1 parent 87141cb53b
commit 47ef86293d
5 files changed
+48 -11

No files matched your search

+6 -5
View File
@@ -7,10 +7,11 @@ lazysecrets shows git repositories under **Repos**: their
## Which repos
**Repos** lists every repo with secret files under the `roots` (`~/git`
by default; one or two levels down, `repo` or `org/repo`), any listed in
`paths`, and any you starred something in (the repo, a file or a key),
wherever it is. They're checked in the background.
**Repos** lists every repo with secret files under the `roots` (by
default whichever of `~/git`, `~/repo`, `~/repos`, `~/projects`, `~/code`,
`~/source` and `~/src` exist; one or two levels down, `repo` or
`org/repo`), any listed in `paths`, and any you starred something in
(the repo, a file or a key), wherever it is. They're checked in the background.
Started inside a repo, that repo gets a row of its own at the top,
`Repo · <name>`, and lazysecrets opens on it, with the files under the
@@ -49,7 +50,7 @@ Folders of dependencies and caches are never looked in, tracked or not:
```yaml
providers:
repos:
roots: [~/git] # folders of repos (the default; [] turns it off)
roots: [~/git] # folders of repos (replaces the defaults; [] turns it off)
paths: [~/work/infra] # single repos elsewhere
include: ["secrets/**", "**/*.sops.yaml"] # globs from the repo root; ** for any depth
exclude: ["**/testdata/**"]