You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scan: ask git once per repo instead of once per folder #4
During a scan, keepAll in internal/sweep/git.go runs git ls-files (and git check-ignore for dist / build / out / target) once per folder that contains targets. #3 batches targets that share a parent folder, but a monorepo with thousands of packages still forks thousands of git processes, which dominates scan time.
At delete time, Vet asks git again for every candidate. That re-check is deliberate (the tree can change between the scan and the delete) and should stay.
Idea
Ask each repo once per scan, for example one git ls-files -z per repo top level, then answer "does this folder hold tracked files?" from that list. Possibly one long-lived git check-ignore --stdin per repo as well.
It changes how the keep-or-delete question is put to git, and a wrong answer deletes tracked files. Things to get right first:
Path comparison on APFS. Paths from readdir and paths from git's index can differ in Unicode normalization (core.precomposeunicode) and in case (core.ignorecase). A mismatch makes a tracked folder look untracked.
Which repo answers. Nested repos, submodules and worktrees must each be asked about their own folders.
Streaming. The interactive list fills in as folders are found, so the answer can't wait for the whole walk.
Activity
Ask git once per repo, cut hard-link memory, stop the scan on quit, c…