Problem
git-scope only detects regular git repositories — directories that contain a .git/ folder. Linked git worktrees (created with git worktree add) are skipped entirely, because in a worktree the .git entry is a file containing a gitdir: pointer to the main repo's worktrees/<name>/ directory, not a directory.
This is a real gap for anyone who uses worktrees for parallel branches (e.g. one tree per in-flight feature). Today those trees are invisible in the dashboard and don't contribute to the dirty/clean totals — so a worktree with uncommitted changes is silently missed.
Where it lives
internal/scan/scan.go walks the tree and only matches when:
if d.IsDir() && d.Name() == ".git" {
A worktree's .git entry is d.Type().IsRegular(), so the walker never records it as a repo.
Proposed change
Add opt-in worktree support:
- Config flag
includeWorktrees: false (default) in ~/.config/git-scope/config.yml.
- CLI flag
--worktrees for one-shot enable.
- TUI keybinding to toggle live (e.g. uppercase
W — lowercase w is already taken by the workspace switcher). The toggle controls both visibility AND the totals (📁 N repos, dirty/clean counts) so the table and stats stay consistent.
- Scanner: when enabled, also detect
.git files (regular files) and treat their parent directory as a repo. git status --porcelain=v2 works in worktrees identically, so internal/gitstatus doesn't need changes.
- Model: add an
IsWorktree bool field on Repo (omitempty) so the TUI can render a small marker (e.g. ⎇ next to the name) and so scripted consumers of git-scope scan JSON can distinguish them.
- Cache: include the flag in cache validity so toggling forces a fresh scan instead of returning the wrong set from disk.
Why opt-in
- Default behaviour stays identical — no surprise count changes for current users.
- Worktree-heavy workflows can be a minority; some users keep many worktrees and don't want them inflating the dashboard.
- A toggle (key + flag + config) lets each user pick their default and override per-session.
UX
Stats bar today:
📁 12 repos ● 3 dirty ✓ 9 clean
With the toggle on:
📁 19 repos (12 + 7 wt) ● 5 dirty ✓ 14 clean
Help bar gains: W toggle worktrees.
Happy to send a PR — already have a fork ready.
Problem
git-scopeonly detects regular git repositories — directories that contain a.git/folder. Linked git worktrees (created withgit worktree add) are skipped entirely, because in a worktree the.gitentry is a file containing agitdir:pointer to the main repo'sworktrees/<name>/directory, not a directory.This is a real gap for anyone who uses worktrees for parallel branches (e.g. one tree per in-flight feature). Today those trees are invisible in the dashboard and don't contribute to the dirty/clean totals — so a worktree with uncommitted changes is silently missed.
Where it lives
internal/scan/scan.gowalks the tree and only matches when:A worktree's
.gitentry isd.Type().IsRegular(), so the walker never records it as a repo.Proposed change
Add opt-in worktree support:
includeWorktrees: false(default) in~/.config/git-scope/config.yml.--worktreesfor one-shot enable.W— lowercasewis already taken by the workspace switcher). The toggle controls both visibility AND the totals (📁 N repos,dirty/cleancounts) so the table and stats stay consistent..gitfiles (regular files) and treat their parent directory as a repo.git status --porcelain=v2works in worktrees identically, sointernal/gitstatusdoesn't need changes.IsWorktree boolfield onRepo(omitempty) so the TUI can render a small marker (e.g.⎇next to the name) and so scripted consumers ofgit-scope scanJSON can distinguish them.Why opt-in
UX
Stats bar today:
With the toggle on:
Help bar gains:
W toggle worktrees.Happy to send a PR — already have a fork ready.