Skip to content

docs(advanced-git): never swap the explicit worktree list for a glob - #146

Merged
CybotTM merged 1 commit into
mainfrom
docs/worktree-cleanup-glob
Aug 6, 2026
Merged

docs(advanced-git): never swap the explicit worktree list for a glob#146
CybotTM merged 1 commit into
mainfrom
docs/worktree-cleanup-glob

Conversation

@CybotTM

@CybotTM CybotTM commented Aug 6, 2026

Copy link
Copy Markdown
Member

The batch-cleanup recipe demonstrates the safe shape — an explicit list of the branches this session created — but never names the unsafe substitution, so replacing it with a directory glob reads as a harmless shortcut.

It is not. A glob cannot tell your worktrees from pre-existing ones, and worktree remove --force followed by branch -D is not undoable from the shell.

Observed 2026-08-06: a 19-repo release sweep cleaned up with */release-v* and removed a leftover release-v1.12.0 worktree and branch belonging to an unrelated release from months earlier. Nothing was lost only because that branch had already been merged and tagged.

Also adds two habits that bound the damage when the list is wrong anyway: worktree list before removing, and branch -d over -D so an unmerged branch survives.

Generated by /retro.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copilot AI lite review requested due to automatic review settings August 6, 2026 10:51
@github-actions github-actions Bot added documentation Improvements or additions to documentation skill labels Aug 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CybotTM
CybotTM merged commit b0a8617 into main Aug 6, 2026
21 of 22 checks passed
@CybotTM
CybotTM deleted the docs/worktree-cleanup-glob branch August 6, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants