gabriel / muse public
feat patch task/ls-tree #1 / 1
gabriel · 62 days ago · Apr 14, 2026 · Diff

feat: implement muse ls-tree command with synthetic directory entries

- _build_tree_entries: synthesizes tree entries from flat manifest by detecting shared path prefixes; non-recursive collapses subdirs into synthetic 040000 tree nodes; recursive lists all blobs only - _synthetic_tree_id: deterministic SHA-256 of sorted (path, oid) pairs under a prefix — gives each synthetic tree a stable, content-addressed ID - _resolve_manifest: resolves HEAD, branch names (via .muse/refs/heads/), and commit IDs (prefix scan) to a manifest - Flags: -r/--recursive, -d/--dirs-only, -l/--long (with byte sizes), --name-only, --json, positional treeish (default HEAD) + path prefix - Text format: '<mode> <type> <object_id>TAB<path>' - JSON schema: treeish + commit_id + entries array - 31 tests: unit helpers, integration (all flag combos, refs, formats), security (path traversal + ANSI rejection), stress (500-file repo)

sha256:2844e173ab1a7d49e0a962310ee2b5d27036143ded9767102735f9848a21a719 sha
sha256:4948278af4a6c0380695e0a088c3f94c4066abd9cfe16f0a433a9f31005cfa86 snapshot
← Older Oldest on task/ls-tree
All commits
Newer → Latest on task/ls-tree

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:2844e173ab1a7d49e0a962310ee2b5d27036143ded9767102735f9848a21a719 --body "your comment"