Skip to content
  • Сергей Никоненко's avatar
    3d9d6f5f
    feat(hooks): live-sync keeps live checkouts on their upstream;... · 3d9d6f5f
    Сергей Никоненко authored
    
    feat(hooks): live-sync keeps live checkouts on their upstream; post-merge-cleanup leaves server-owned deletes alone
    
    live-sync (SessionStart). Config lives in a repo and ~/.claude links into it; if
    the links point at a working clone, what runs is whatever branch that clone is on.
    A merge tool ran from a feature branch 165 commits behind main for a month. The
    fix is a checkout nobody edits plus this hook: ~/.claude/live-checkouts lists the
    copies; each is fast-forwarded (branch: merge --ff-only, detached: checkout
    --detach) and then runs its post-sync command. Tracked edits, own commits, fetch
    or command failures are reported and the copy is left alone. git refuses to walk
    a branch off its own commits but not a detached HEAD, so the check is ours; the
    mutation without it goes red. 21 cases; 8 guards mutated, 7 red, the 8th is an
    equivalent mutant (merge --ff-only on a detached HEAD does the same).
    
    post-merge-cleanup: when the MR asks the server to delete its branch
    (force_remove_source_branch), leave it to the server. On a real merge the hook
    raced it and reported "kept: remote ref does not exist" for a deleted branch.
    
    Co-Authored-By: default avatarClaude Opus 5.5 <[email protected]>
    3d9d6f5f
    feat(hooks): live-sync keeps live checkouts on their upstream;...
    Сергей Никоненко authored
    
    feat(hooks): live-sync keeps live checkouts on their upstream; post-merge-cleanup leaves server-owned deletes alone
    
    live-sync (SessionStart). Config lives in a repo and ~/.claude links into it; if
    the links point at a working clone, what runs is whatever branch that clone is on.
    A merge tool ran from a feature branch 165 commits behind main for a month. The
    fix is a checkout nobody edits plus this hook: ~/.claude/live-checkouts lists the
    copies; each is fast-forwarded (branch: merge --ff-only, detached: checkout
    --detach) and then runs its post-sync command. Tracked edits, own commits, fetch
    or command failures are reported and the copy is left alone. git refuses to walk
    a branch off its own commits but not a detached HEAD, so the check is ours; the
    mutation without it goes red. 21 cases; 8 guards mutated, 7 red, the 8th is an
    equivalent mutant (merge --ff-only on a detached HEAD does the same).
    
    post-merge-cleanup: when the MR asks the server to delete its branch
    (force_remove_source_branch), leave it to the server. On a real merge the hook
    raced it and reported "kept: remote ref does not exist" for a deleted branch.
    
    Co-Authored-By: default avatarClaude Opus 5.5 <[email protected]>
Loading