Skip to content

feat: consolidate worktree-branch-delete into worktree-branch -d/-D#253

Merged
avihut merged 2 commits intomasterfrom
feat/branch-delete-simplification
Feb 22, 2026
Merged

feat: consolidate worktree-branch-delete into worktree-branch -d/-D#253
avihut merged 2 commits intomasterfrom
feat/branch-delete-simplification

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Feb 22, 2026

Summary

  • Absorbs the standalone git-worktree-branch-delete command into git-worktree-branch -d/-D, mirroring how git branch -d/-D works
  • Follows the same pattern established in feat: add daft verb aliases and consolidate checkout-branch into checkout -b #250 (consolidating checkout-branch into checkout -b)
  • daft remove now injects -d before clap parsing (same as daft start injects -b)
  • The old git-worktree-branch-delete is kept as a deprecated backward-compat shim with a stderr warning

Changes

New command: git worktree-branch -d/-D

  • -d (safe delete): checks merge status, uncommitted changes, remote sync
  • -D (force delete): bypasses safety checks (except default branch protection)
  • Error without -d/-D with usage hint

Routing updates

  • daft removeworktree_branch::run_remove() (injects -d)
  • gwtbd shortcut → git-worktree-branch -d
  • Shell wrappers updated for bash/zsh/fish

Backward compatibility

  • git worktree-branch-delete still works, prints deprecation warning
  • All existing integration tests continue to pass unchanged

Test plan

  • mise run fmt passes
  • mise run clippy passes (zero warnings)
  • mise run test:unit passes (366 tests)
  • mise run man:verify passes
  • mise run docs:cli:verify passes
  • mise run test:integration — new tests for -d, -D, no-flag error, and deprecation warning
  • Manual test: git worktree-branch -d <branch> safe delete
  • Manual test: git worktree-branch -D <branch> force delete
  • Manual test: daft remove <branch> still works
  • Manual test: git-worktree-branch-delete <branch> shows deprecation warning

🤖 Generated with Claude Code

avihut and others added 2 commits February 22, 2026 17:47
Following the pattern from #250 (checkout-branch → checkout -b), absorb
the standalone git-worktree-branch-delete command into
git-worktree-branch -d/-D, mirroring git branch -d/-D semantics.

- git worktree-branch -d: safe delete (checks merge status)
- git worktree-branch -D: force delete
- daft remove: injects -d before parsing (same as daft start injects -b)
- git-worktree-branch-delete: kept as deprecated shim with warning
- gwtbd shortcut: now routes to git-worktree-branch -d

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The new git-worktree-branch command was missing from the symlink
creation and verification lists in the CI test and homebrew workflows,
causing integration tests to fail with "command not found".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avihut avihut merged commit f4e3503 into master Feb 22, 2026
6 checks passed
@avihut avihut deleted the feat/branch-delete-simplification branch February 22, 2026 21:29
This was referenced Feb 22, 2026
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.

1 participant