Skip to content

feat: add --list, --backup, root-aggregate _toc.md, and --filter - #3

Merged
harehare merged 2 commits into
mainfrom
feat/list-backup-toc-filter
Sep 2, 2026
Merged

feat: add --list, --backup, root-aggregate _toc.md, and --filter #3
harehare merged 2 commits into
mainfrom
feat/list-backup-toc-filter

Conversation

@harehare

@harehare harehare commented Sep 2, 2026

Copy link
Copy Markdown
Owner
  • --list enumerates currently running background mounts (self-healing against stale pid files from a hard kill).
  • --backup snapshots each source file's pre-edit bytes to .orig before the first write, mitigating the documented "not byte-exact" first-save behavior.
  • --toc now also exposes a mount-root aggregate _toc.md listing every mounted file's heading tree in one read, alongside the existing per-file one.
  • --filter uses mq's own query language (mq-lang) to expose only sections whose heading matches keeping ancestors of a match reachable by path. Always mounts read-only, even with --write, since writing into a partially-visible document is out of scope.

- --list enumerates currently running background mounts (self-healing
  against stale pid files from a hard kill).
- --backup snapshots each source file's pre-edit bytes to <file>.orig
  before the first write, mitigating the documented "not byte-exact"
  first-save behavior.
- --toc now also exposes a mount-root aggregate _toc.md listing every
  mounted file's heading tree in one read, alongside the existing
  per-file one.
- --filter <QUERY> uses mq's own query language (mq-lang) to expose
  only sections whose heading matches, keeping ancestors of a match
  reachable by path. Always mounts read-only, even with --write, since
  writing into a partially-visible document is out of scope.

document.rs/fs.rs stay free of any mq-lang dependency (HeadingFilter is
a generic closure type); the query engine itself is confined to
src/query_filter.rs, gated behind the `mount` feature, so the core
still builds and tests with --no-default-features.
Path::file_name() returns None when the whole path is just `.` or
`..`, so passing `.` as a source directory fell back to naming its
top-level mount entry (and NFS export) "untitled" instead of the
real directory name. Canonicalize before deriving the name.
@harehare
harehare merged commit 6505ae0 into main Sep 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant