gabriel / muse public
Open #22
filed by gabriel human · 1 day ago

muse pull does not prune stale remote tracking refs after hub-side branch deletion

0 Anchors
Blast radius
Churn 30d
0 Proposals

Summary

When a merge proposal is merged on the hub with 'Source branch deleted', the tracking ref under .muse/remotes/<remote>/<branch> is not removed by the subsequent muse pull. The user must run muse fetch <remote> --prune as a separate explicit step.

Steps to reproduce

  1. Push a branch and create an MP
  2. Merge the MP on the hub (source branch auto-deleted)
  3. muse switch dev && muse pull local dev
  4. tree .muse/remotes — stale tracking ref still present

Expected behavior

muse pull local dev should behave as muse fetch local --prune && muse merge local/dev — pruning any tracking refs for branches the remote no longer reports. At minimum, the MP merge response (which confirms source branch deletion) should trigger a prune of that specific ref.

Actual behavior

Stale tracking refs accumulate silently. The only way to clear them is an explicit muse fetch <remote> --prune.

Context

This surfaced during a remote branch cleanup session. After merging MP #8 into local dev, .muse/remotes/local/fix/proposal-closed-state-badge persisted until manually pruned.

Activity1
gabriel opened this issue 1 day ago
gabriel 1 day ago

Proposed solution: fetch.prune config option

Mirror git's fetch.prune behavior exactly.

Config (set once, applies to all fetches in that repo):

muse config set fetch.prune true

Behavior when set:

  • muse fetch <remote> — prunes stale tracking refs automatically
  • muse pull <remote> <branch> — prunes as part of the fetch step

Behavior when unset (default): current behavior — no pruning, explicit muse fetch <remote> --prune required.

Global variant (applies across all repos on the machine):

muse config set --global fetch.prune true

This is the exact pattern git uses (git config --global fetch.prune true). Agents and humans who set it once never have to think about stale tracking refs again. The --prune flag on muse fetch stays as an explicit one-shot override regardless of config.