FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(worktree): auto-prune old worktrees on create, keep N recent by qiankunli · Pull Request #56 · compforge/devloop · GitHub

feat(worktree): auto-prune old worktrees on create, keep N recent - #56

Merged
qiankunli merged 2 commits into
mainfrom
feat/worktree-keep-recent
Jul 4, 2026
Merged

feat(worktree): auto-prune old worktrees on create, keep N recent#56
qiankunli merged 2 commits into
mainfrom
feat/worktree-keep-recent

Conversation

Copy link
Copy Markdown
Collaborator

Every worktree creation (resolve_subproject.make_worktree, not just /enter) now
prunes the repo's surplus worktrees so day-to-day work stops accumulating disk.

  • config: flat worktree.keep_recent (default 5); no repos map — a repo's
    .devloop/config.json overrides the global via the existing distance-layered
    load(). Semantics: N>0 keep N newest, 0 keep none, N<0 disable.
  • pruning targets only devloop-managed worktrees under /.worktrees/ (and
    legacy worktrees/); primary checkout and external/sibling worktrees untouched.
  • protections: the just-made worktree, ones held by another live session, and
    dirty ones (non-force git worktree remove refuses them) are spared. Branches
    are kept — a removed worktree's branch survives and re-enter rebuilds it.
  • recency ranks on per-worktree git index mtime (+ dir mtime), not HEAD commit
    time, which would tie worktrees sharing a trunk baseline.

Every worktree creation (resolve_subproject.make_worktree, not just /enter) now
prunes the repo's surplus worktrees so day-to-day work stops accumulating disk.

- config: flat worktree.keep_recent (default 5); no repos map — a repo's
  .devloop/config.json overrides the global via the existing distance-layered
  load(). Semantics: N>0 keep N newest, 0 keep none, N<0 disable.
- pruning targets only devloop-managed worktrees under <main>/.worktrees/ (and
  legacy worktrees/); primary checkout and external/sibling worktrees untouched.
- protections: the just-made worktree, ones held by another live session, and
  dirty ones (non-force git worktree remove refuses them) are spared. Branches
  are kept — a removed worktree's branch survives and re-enter rebuilds it.
- recency ranks on per-worktree git index mtime (+ dir mtime), not HEAD commit
  time, which would tie worktrees sharing a trunk baseline.
qiankunli merged commit dd06691 into main Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 devloop code-review · origin/main..HEAD · be50b28e7 · models: deepseek-v4-pro×7, seed-2.1-pro×7, seed-2.1-turbo×7 · cost: 602s · ccr v1.7.1

✅ 无 findings(clean)。

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL