Skip to content

cleaner: merged branches and orphaned temp worktrees (left from the old tools) #519

Closed

Description

@scuttletoby

Follow-up to #491. fork-cleaner now runs on its own on the main dev host (daily.mode: run); the two old project timers are off.

Two jobs the old tools did that fork-cleaner has no rule for yet, so these now pile up (harmless for a few days, but they never go away):

  1. Merged branches with no worktree. The old worktree pruner also deleted local work/* branches whose PR is merged and that have no worktree (14 in its last dry run). Wanted: a general rule in the worktrees rule (or its own rule) that deletes a local branch matching the configured branches patterns when its PR is merged and the branch tip is reachable from the default branch or from the merged PR's head. Same keep checks as worktrees: unpushed commits keep it.
  2. Orphaned temp worktrees. In the last compare, fork-cleaner kept 59 temp folders that are git worktrees whose admin entry is gone ("orphaned"), which the old retention tool deleted by pattern and age. Wanted: decide when an orphaned worktree in a configured tmp pattern is safe to delete (no unpushed commit can be found in it, older than the pattern's days) and add that as a general rule with tests, or say why it should stay kept.

State question for both: runs again (second run finds nothing), stops half-way (a branch deleted but its reflog entry left, a folder half removed), old or empty state (no branches match, a repo with no remote).

Each rule: general (patterns from the machine file), tests in the cleaner suites, and a row in the cleaner README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions