gabriel / muse public
fix BREAKING read-commit task/ax-read-commit-canonical-refs #1 / 1
gabriel · 164 days ago · Apr 16, 2026 · Diff

fix(read-commit): accept sha256: canonical prefix, HEAD, and branch refs

- Full sha256:<64-hex> and sha256:<partial-hex> prefix forms now resolve - HEAD, branch names, and HEAD~N tilde notation now resolve - Bare hex (without sha256: prefix) is rejected with a clear error instructing callers to use the canonical form - test_snapshot_id_in_output updated: sha256: prefix is canonical, length is 71 not 64

sha256:f912682d43efa52588f51009f5042ef23693064608992c569f774734b45abdfa sha
+16 ~11 −2 symbols
sha256:764541798af87ee6fdf548a1ef9c7b8ff6bc318c5c64f174a522bf31b7281ded snapshot
+16
symbols added
~11
symbols modified
−2
symbols removed
0
dead code introduced
Semantic Changes 29 symbols
~ muse/cli/commands/read_commit.py .py 8 symbols added, 1 symbol removed, 6 symbols modified
− validate_object_id import import validate_object_id L54–54
+ _BARE_HEX_RE variable variable _BARE_HEX_RE L66–66
+ _SHA256_FULL_RE variable variable _SHA256_FULL_RE L64–64
+ _SHA256_PREFIX_RE variable variable _SHA256_PREFIX_RE L65–65
+ get_head_commit_id import import get_head_commit_id L54–54
+ re import import re L50–50
+ read_head import import read_head L54–54
+ read_repo_id import import read_repo_id L53–53
+ resolve_commit_ref import import resolve_commit_ref L54–54
~ run
~ tests/test_cmd_read_commit.py .py 8 symbols added, 1 symbol removed, 5 symbols modified
− test_8char_prefix_resolves method method test_8char_prefix_resolves L203–208
+ test_bare_hex_rejected method method test_bare_hex_rejected L244–250
+ test_bare_short_hex_rejected method method test_bare_short_hex_rejected L252–258
+ test_sha256_full_id_resolves method method test_sha256_full_id_resolves L214–220
+ test_sha256_short_prefix_resolves method method test_sha256_short_prefix_resolves L204–212
+ TestSymbolicRefResolution class class TestSymbolicRefResolution L266–294
+ test_branch_name_resolves method method test_branch_name_resolves L277–284
+ test_head_resolves method method test_head_resolves L267–275
+ test_tilde_notation_resolves method method test_tilde_notation_resolves L286–294
← Older Oldest on task/ax-read-commit-canonical-refs
All commits
Newer → Latest on task/ax-read-commit-canonical-refs

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