feat: implement muse format-patch — export commits as .patch files
- _make_patch_filename: numbered (0001-...), filesystem-safe subject sanitization (strips control chars, replaces /\..*?:<>|, collapses hyphens, truncates to 52 chars + extension) - _format_patch_content: mail-format headers (Date, Subject [PATCH N/M], X-Muse-Commit-ID) + unified diff for each changed file, sorted by path - _resolve_commit_range: resolves HEAD/branch/commit + -N shorthand by walking the parent_commit_id chain N steps back; returns oldest-first - run: resolves range → formats each patch → writes to files or --stdout; --json emits {patches: [{file, commit_id, subject}]} - 17 tests: unit (filename numbering, sanitization, content headers/diff lines), integration (single commit, numbered filename, muse header, diff content, --stdout, --json schema, initial commit no-parent, empty repo error), security (malicious subject → safe filename), stress (-9 flag produces 9 patch files)
0 comments
muse hub commit comment sha256:5251840b865e589605e4740cf8c4649ee3d1cf79ca3ba315fc27f1a6483c009b --body "your comment"
No comments yet. Be the first to start the discussion.