Closed
#7
muse merge does not resolve remote tracking refs (origin/main syntax)
0
Anchors
—
Blast radius
—
Churn 30d
0
Proposals
Bug
After muse fetch origin, the remote tracking ref is correctly stored at .muse/remotes/origin/main. But muse merge origin/main fails:
❌ Branch 'origin/main' has no commits.
get_head_commit_id calls validate_branch_name which rejects the slash, then raises — the remote tracking ref is never consulted.
The same gap affects any command that resolves a branch ref: muse merge, muse merge-base, muse log --all, muse branch -a.
Expected behaviour (idiomatic)
After muse fetch origin:
muse merge origin/mainresolvesorigin/main→.muse/remotes/origin/main→ commit IDmuse branch -a --jsonlists remote tracking branches alongside local onesmuse log --all --jsonincludes commits reachable from remote tracking refs
Fix
Add a resolve_tracking_ref(root, ref) helper that, when a ref contains /, splits on the first / and reads .muse/remotes/<remote>/<branch>. Thread this through get_head_commit_id (or a new resolve_any_ref wrapper) and the merge command's branch resolution.
TDD
Write failing tests in muse/tests/test_remote_tracking_refs.py that:
- Assert
muse merge origin/mainexits 0 after a fetch - Assert
muse branch -a --jsonincludesorigin/mainin the output - Assert
muse log --all --jsonincludes the fetched commit
Then make them green.
Activity1
Fixed in dev. 7/7 tests green.
resolve_any_ref()added tostore.py— tries local branch first, then.muse/remotes/<remote>/<branch>for bothorigin/mainandremotes/origin/mainsyntaxmuse merge origin/mainnow resolves correctly after fetchmuse log --all --jsonnow walks remote tracking tips;_branch_tips(include_remote=True)also used in the graph renderTDD: tests written first, all 7 failed, all 7 now green.