feat: muse reflog diff @{N} @{M} (muse#54 item 7)
`muse diff "@{N}" "@{M}"` already worked -- resolve_commit_ref already resolves @{N} specs via the existing reflog machinery, confirmed live before writing any code. The actual gap was convenience: manually constructing the "<branch>@{N}" spec strings for both sides every time.
`muse reflog diff N M [--branch <name>]` is a thin wrapper: builds the two @{N} spec strings (prefixed with the branch name when --branch is given, bare @{N} against the HEAD log otherwise) and delegates directly to muse.cli.commands.diff.run() via a synthetic argparse.Namespace with every other diff flag at its default -- the exact same diff engine `muse diff` uses, not a reimplementation. index_b defaults to 0 (the most recent entry), so `muse reflog diff 2` alone compares @{2} against the current state.
New tests/test_reflog_diff.py (5): diff between two HEAD-log indices shows real changes, the second index defaults to 0, --branch prefixes both ref strings correctly, identical indices report no changes, and an out-of-range index fails cleanly (exit 1, matching resolve_commit_ref's own IndexError handling). Confirmed genuine RED (5/5 failed -- unrecognized "diff" reflog subcommand) before GREEN with the fix restored.
Targeted regression suite -- the new file plus test_cmd_reflog.py, test_cmd_reflog_hardening.py -- all pass (86 passed), zero regressions.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
26 symbols
Files Changed
+1
~2
1224 in snapshot
0 comments
muse hub commit comment sha256:2af883aa70af9cec92cf4b5ca9b2574ff23e6f679d9eb4771c6e40d4822152a7 --body "your comment"
No comments yet. Be the first to start the discussion.