gabriel / muse public
feat patch task/log-branch-flag #1 / 1
AI Agent gabriel · 11 days ago · Jul 5, 2026 · Diff

feat: add --branch/-b flag to muse log

muse log already read history from an arbitrary branch/commit via the positional ref argument (muse log main), with no working-tree or HEAD side-effects, but had no explicit --branch/-b flag — callers reaching for the more self-documenting form got 'unrecognized arguments: --branch'.

Adds --branch/-b as an explicit alias for the positional ref, composable with all existing flags (--oneline, --max-count, --json, etc.). Passing both --branch and a positional ref is rejected as ambiguous.

Closes #45.

sha256:c69d8cff372b002f2871cf609d58e7c825be78f5db5a0cc9347c66ca17f7fc30 sha
+22 ~2 symbols
sha256:8badfd4d8dcfc7c4d04aae15b858f63d58a4a2ccda53d97893bd1f80662c2c94 snapshot
+22
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 24 symbols
~ tests/test_log_branch_flag.py .py 22 symbols added
+ TestBranchFlagAmbiguity class class TestBranchFlagAmbiguity L129–137
+ test_branch_flag_and_positional_ref_together_is_rejected method method test_branch_flag_and_positional_ref_together_is_rejected L130–137
+ TestBranchFlagBasic class class TestBranchFlagBasic L77–126
+ test_branch_flag_composes_with_oneline_and_max_count method method test_branch_flag_composes_with_oneline_and_max_count L103–117
+ test_branch_flag_does_not_touch_head method method test_branch_flag_does_not_touch_head L95–101
+ test_branch_flag_matches_positional_ref method method test_branch_flag_matches_positional_ref L78–86
+ test_branch_flag_with_json method method test_branch_flag_with_json L119–126
+ test_short_flag_b method method test_short_flag_b L88–93
+ _checkout function function _checkout L50–52
+ _commit function function _commit L42–47
+ _current_branch function function _current_branch L55–57
+ _init function function _init L37–39
+ _invoke function function _invoke L26–34
+ _log_json function function _log_json L60–62
+ _two_branch_repo function function _two_branch_repo L65–74
+ CliRunner import import CliRunner L21–21
+ InvokeResult import import InvokeResult L21–21
+ annotations import import annotations L15–15
+ json import import json L17–17
+ os import import os L18–18
+ pathlib import import pathlib L19–19
+ runner variable variable runner L23–23
~ muse/cli/commands/log.py .py 2 symbols modified
← Older Oldest on task/log-branch-flag
All commits
Newer → Latest on task/log-branch-flag

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