mirror of
https://github.com/Dasemu/Grove.git
synced 2026-11-26 07:16:11 +00:00
docs: describe runtime rediscovery in the daemon
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b5e5d5367
commit
3784e1533b
2 files changed
+24
-2
No files matched your search
+2
-2
@@ -59,7 +59,7 @@ socket is refused; a stale socket file left by a crash is replaced.
|
||||
|
||||
JSON lines in `<state dir>/activity.jsonl` (rotated at 5 MiB to `.jsonl.1`), the last 500 events in
|
||||
memory, and live via `subscribe`. Kinds: `start`, `stop`, `snapshot`, `fast_forward`, `applied`,
|
||||
`declined`, `snapshots_withheld`, `snapshots_enabled`, `snapshots_purged`, `state` (worktree state changed), `materialized`, `archived`, `error`, `watch_error`,
|
||||
`declined`, `snapshots_withheld`, `snapshots_enabled`, `snapshots_purged`, `state` (worktree state changed), `materialized`, `archived`, `repo_added`, `repo_removed`, `error`, `watch_error`,
|
||||
`pause`, `resume`.
|
||||
|
||||
## CLI
|
||||
@@ -99,6 +99,6 @@ discard the staged version).
|
||||
- Peer-credential check on the socket: access control is the 0700 directory only.
|
||||
- GUI/tray (Phase 3), providers and wizards (Phase 4).
|
||||
- Remote-change notifications (webhooks); only polling at `fetch_interval_s`.
|
||||
- Config reload: restart the daemon after editing `config.toml`.
|
||||
- Config reload: restart the daemon after editing `config.toml`. (Repos added, migrated or removed under the configured groups are picked up at runtime; see `docs/phase6.md`.)
|
||||
- Watching skips no heavy ignored directories (`node_modules`, `target`) at watch time; add them to
|
||||
`sync.ignore_extra` to avoid triggering passes, and raise the inotify limit if needed.
|
||||
@@ -74,6 +74,28 @@ groups, repos directly under the root. Ignored plain clones inside a configured
|
||||
"not migrated (run grove add)" by `grove daemon status` and `grove doctor`. Discovery reads one
|
||||
directory per configured group, so it stays cheap.
|
||||
|
||||
### Rediscovery at runtime
|
||||
|
||||
Discovery is not startup-only. The daemon watches (non-recursively) the root, each configured group
|
||||
directory and every child directory that is not managed yet; managed repos keep their recursive
|
||||
watch. A child directory created, deleted or renamed, or `.bare` / `.git` appearing or disappearing
|
||||
inside one (`grove add` migrating a clone, `grove import` cloning into `<group>/<name>/.bare`,
|
||||
a clone moved to the trash) triggers a debounced (500 ms) rediscovery and diff:
|
||||
|
||||
- New bare-layout repos are managed at once: watches set up, a pass scheduled, activity event
|
||||
`repo_added`.
|
||||
- Repos that are gone (or no longer bare layout) are dropped with their watches and state, one
|
||||
`repo_removed` event, no error; their files are never touched. A repo whose directory vanishes
|
||||
while a pass runs is dropped the same way.
|
||||
- The "not migrated" list is refreshed.
|
||||
|
||||
As a safety net every full pass (every `fetch_interval_s`) re-runs discovery too, so missed
|
||||
inotify events delay detection by at most that interval. `grove daemon status` reflects the new set
|
||||
right after rediscovery, also while paused (discovery runs while paused, syncing does not).
|
||||
|
||||
Config reload is still out of scope: restart the daemon after editing `config.toml` (new or removed
|
||||
groups are only picked up then).
|
||||
|
||||
**Breaking change:** group names must now be plain directory names (non-empty, no `/`, no leading
|
||||
`.`); a config with other names no longer loads.
|
||||
|
||||
|
||||
Reference in new issue
Block a user