Skip to content

v0.1.38

Choose a tag to compare

@eharriett0 eharriett0 released this 17 Nov 16:33
· 10 commits to main since this release
dadaed9

Data-loss fixes to the removal paths, locking for the coordination log, and section-aware edit hooks.

  • #230: auto-clean and wt clean delete only what they checked.
    • The bug. merge-pr's auto-clean usually runs inside the worktree it removes, so the branch delete ran in the removed directory and failed. The cd hint named that same directory. Making the delete work exposed guards the failure had been hiding.
    • The fix. The removal and the branch delete run from the main checkout (in a bare repository, the repository itself), and the cd hint names it.
    • Every remover now:
      • deletes the branch only at the tip it checked, in one step (update-ref -d <ref> <tip>), so a commit landing after the check is never deleted with it;
      • makes a relative path absolute from the cwd first;
      • keeps a case twin of the base (Main under core.ignorecase is main's loose ref).
    • wt clean:
      • A merged PR reaps a worktree only when the branch's tip is the PR's head or an ancestor of it. A commit made after the merge keeps the worktree, and clean says how many commits the PR lacks.
      • When the PR's head was never fetched here, it fetches refs/pull/<n>/head once.
      • It removes the cwd's worktree last.
    • release --clean:
      • It removes only a worktree still on the claim's branch.
      • It reads origin from the main checkout.
      • It deletes origin's placeholder with a lease on the tip it checked.
    • The no-prompt fetch has a deadline and stops its whole process group.
  • #229 and #234: the coordination log is locked for writes and reads.
    • wt announce, ack and every other write takes the log's lock, so a record written while wt prune-coord rewrites the log is never lost (#229).
    • Readers take a shared lock, so a read during the rewrite never sees an empty log. That empty read was how merge-pr's hold gate could let a merge through past a hold (#234).
    • A reader waits at most 5s for a stopped writer, then reads as before. The hold gate refuses instead, and says to resume the stopped process, not kill it.
  • #226: the edit hooks re-grade a structured doc by section.
    • An edit moving into another window's section warns (or denies under the block switch), and one moving out stops warning, as wt check grades it after the edit. Before, both hooks ignored sections.
    • A section HIGH whose heading the edit deletes stays a heads-up (#237 tracks the real fix in the grader).
  • #238: a relative worktree_root or active_work is read from the main checkout, so it names one directory from every window. A claim recorded relative before this is found by its branch.