feat: muse#54 item 2 — muse reflog --format oneline/patch
Adds `--format {text,oneline,patch}` to `muse reflog` (default: text, the existing multi-line block format).
- oneline: `@{N} <full_sha> <operation>` per line, mirroring `muse log --oneline`'s convention — machine-parseable without the overhead of full JSON. - patch: each entry's oneline header followed by the diff it introduced, delegating to the same diff engine as `muse diff` via a synthetic argparse.Namespace (the same pattern `reflog diff` already uses). An entry whose old_id is the null-commit sentinel (the first entry in a log) prints a note instead of attempting to resolve the all-zero ID as a real commit.
--format and --json are mutually exclusive — JSON already has its own stable schema and doesn't need a third format dimension layered on top.
Covered by tests/test_reflog_format.py (4 cases: oneline row-per-entry, oneline+json mutual exclusion, patch shows diff after header, patch handles the initial-entry no-diff case without crashing). Confirmed genuine RED by reverting the fix file and re-running (all 4 failed, 3 with exit 2 unrecognized flag, 1 wrong exit code), then GREEN with the fix restored plus the full reflog + diff regression suite (226 passed, zero regressions). Live-verified via muse-dev against a disposable /tmp sandbox.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
26 symbols
Files Changed
+1
~2
1227 in snapshot
0 comments
muse hub commit comment sha256:5e26071aa96fb5024f64ff92210d420ce11305b44d09ed92207df404c6c6a44e --body "your comment"
No comments yet. Be the first to start the discussion.