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
Herdr keeps the sidebar git info (branch name, ahead/behind counts) fresh by polling the filesystem on a hardcoded 1.5s interval (GIT_REMOTE_STATUS_REFRESH_INTERVAL, src/app/mod.rs:38). The loop is active by default: the default sidebar
spaces layout includes branch and git_status tokens (src/config/sidebar.rs:415-424), so git_refresh_demand() is never empty whenever workspaces exist (src/app/git_refresh.rs:102-112).
In worktree-heavy sessions this produces sustained disk I/O:
Every 1.5s, each workspace triggers a chain of file reads: .git discovery walking up from the cwd (src/workspace/git/discovery.rs:244-262), the linked worktree's own HEAD (src/workspace/git/status.rs:253-269), user and repo git config
including include chains (src/workspace/git/config.rs:13-55), and loose refs plus a full packed-refs scan (src/workspace/git/discovery.rs:264-287).
The git status cache is keyed per-checkout repo_root (src/workspace/git/status.rs:68-74), so linked worktrees of the same repository do not share a refresh cycle — N open worktrees means N× the file reads every 1.5s.
When an agent is active in a worktree (commits, branch switches), the fingerprint changes on each cycle, defeating the cache and additionally spawning git rev-list --left-right --count (src/workspace/git/status.rs:306-325) — plus git
symbolic-ref / git rev-parse subprocesses on reftable repos (src/workspace/git/discovery.rs:159-169).
cwd changes reported by panes (TerminalCwdReported) trigger an immediate full discovery refresh (src/app/api.rs:293-297).
The result is a constant stream of reads against the same small set of git metadata files (.git/HEAD, config, packed-refs), scaled by the number of open worktrees.
Requested behavior
Make the refresh interval configurable (e.g. a git_status_refresh_interval setting), and/or
Reduce the per-cycle cost:
- key the status cache by the common git dir so linked worktrees of one repo share a single refresh;
- cache packed-refs and branch config lookups by mtime so unchanged metadata is not re-read every cycle;
- skip branch-config reads when the status fingerprint is unchanged.
Workaround today
Removing branch / git_status from [ui.sidebar.spaces] rows stops the loop entirely (git_refresh_deadline() returns None), at the cost of losing the sidebar git display.
Additional observations
Session persistence rewrites session.json plus session-history.json (full pane ANSI scrollback, pretty-printed) on a 5s debounce while the session is dirty (src/persist/io.rs:44-76). With output-heavy panes this is a smaller but
noticeable secondary write source; a size cap or incremental write would help.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Herdr keeps the sidebar git info (branch name, ahead/behind counts) fresh by polling the filesystem on a hardcoded 1.5s interval (GIT_REMOTE_STATUS_REFRESH_INTERVAL, src/app/mod.rs:38). The loop is active by default: the default sidebar
spaces layout includes branch and git_status tokens (src/config/sidebar.rs:415-424), so git_refresh_demand() is never empty whenever workspaces exist (src/app/git_refresh.rs:102-112).
In worktree-heavy sessions this produces sustained disk I/O:
including include chains (src/workspace/git/config.rs:13-55), and loose refs plus a full packed-refs scan (src/workspace/git/discovery.rs:264-287).
symbolic-ref / git rev-parse subprocesses on reftable repos (src/workspace/git/discovery.rs:159-169).
The result is a constant stream of reads against the same small set of git metadata files (.git/HEAD, config, packed-refs), scaled by the number of open worktrees.
Requested behavior
- key the status cache by the common git dir so linked worktrees of one repo share a single refresh;
- cache packed-refs and branch config lookups by mtime so unchanged metadata is not re-read every cycle;
- skip branch-config reads when the status fingerprint is unchanged.
Workaround today
Removing branch / git_status from [ui.sidebar.spaces] rows stops the loop entirely (git_refresh_deadline() returns None), at the cost of losing the sidebar git display.
Additional observations
noticeable secondary write source; a size cap or incremental write would help.
All reactions