gabriel / muse public
feat patch feat/54-reflog-format #1 / 1
AI Agent gabriel · 11 hours ago · Oct 21, 2026 · Diff

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]>

sha256:5e26071aa96fb5024f64ff92210d420ce11305b44d09ed92207df404c6c6a44e sha
+21 ~5 symbols
3 changed · 1227 in snapshot files
sha256:5699219c917fda41caf95934c681554f8d32257f063143d2a5995c76f28680a6 snapshot
+21
symbols added
~5
symbols modified
3
files changed
1227
files in snapshot
0
dead code introduced
Semantic Changes 26 symbols
~ tests/test_reflog_format.py .py 19 symbols added
+ TestReflogFormatOneline class class TestReflogFormatOneline L52–71
+ test_oneline_mutually_exclusive_with_json method method test_oneline_mutually_exclusive_with_json L66–71
+ test_oneline_one_row_per_entry method method test_oneline_one_row_per_entry L53–64
+ TestReflogFormatPatch class class TestReflogFormatPatch L74–91
+ test_patch_initial_entry_has_no_diff_crash method method test_patch_initial_entry_has_no_diff_crash L85–91
+ test_patch_shows_diff_after_header method method test_patch_shows_diff_after_header L75–83
+ _commit_file function function _commit_file L43–49
+ _env function function _env L19–20
+ _init_repo function function _init_repo L27–40
+ _run function function _run L23–24
+ cli variable variable cli L15–15
+ CliRunner import import CliRunner L11–11
+ Manifest import import Manifest L12–12
+ annotations import import annotations L6–6
+ fake_id import import fake_id L12–12
+ json import import json L8–8
+ muse_dir import import muse_dir L13–13
+ pathlib import import pathlib L9–9
+ runner variable variable runner L16–16
~ muse/cli/commands/reflog.py .py 2 symbols added, 2 symbols modified
+ _fmt_oneline function function _fmt_oneline L204–212
+ _print_entry_patch function function _print_entry_patch L215–244
~ run
Files Changed
+1 ~2
1227 in snapshot
← Older Oldest on feat/54-reflog-format
All commits
Newer → Latest on feat/54-reflog-format

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:5e26071aa96fb5024f64ff92210d420ce11305b44d09ed92207df404c6c6a44e --body "your comment"