Repository navigation
Let pair prune take name patterns - #66
Merged
Merged
Conversation
pair prune [PATTERN...] covers only the channels whose name matches a pattern, so a user can delete some removed worktrees' history and keep the rest. Patterns are shell-style: * any run of characters, ? any one, everything else literal. They only narrow the list; a channel prune can't place is never selected. No match prints the patterns. The matcher works on code points, so ? takes a whole emoji, and backtracks only to the last star, so its time stays bounded by pattern length times name length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Y3kg5hjT2zSZM9qUEEinM
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pair prune [PATTERN...] [--dry-run] [--yes]: with patterns, prune covers only channels whose name matches one, so you can delete some removed worktrees' history and keep the rest (e.g.pair prune 'acq-mono-at-18*').*any run of characters,?any one, everything else literal. They only narrow the existing list; channels prune can't place are never selected. No match printsno channel matches '…'.?takes a whole emoji) and backtracks only to the last*, so matching time stays bounded by pattern × name length.Review
Reviewed by codex over two rounds: round 1 found
?matching UTF-16 code units and exponential backtracking with multiple*in the first regex-based version; both fixed with a dedicated matcher and regression tests, approved in round 2 (codex also cross-checked the matcher against an independent DP matcher on 1.1M pattern/name pairs).Test plan
npm run build,git diff --checknpm test: 232 passednode dist/pair.js prune 'acq-mono-at-18*' --dry-runon a real~/.pair: 19 listed, nothing deleted🤖 Generated with Claude Code
https://claude.ai/code/session_012Y3kg5hjT2zSZM9qUEEinM