Repository navigation
Require typed confirmation to delete branches with unmerged changes - #13
Merged
AgileIndustrialComplex merged 1 commit intoJul 19, 2026
Merged
Conversation
`git branch -d` (non-force) silently refuses branches that aren't fully merged, so deleting one via the mark-then-D flow previously just failed. gitdata.Collect now detects merge status per branch (git branch --merged), and if any marked branch is unmerged, confirming delete opens a second screen requiring the user to type an exact phrase before the batch is force-deleted (git branch -D for the unmerged ones, -d for the rest). Batches with no unmerged branches are unaffected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
git branch -d(non-force) silently refuses to delete a branch that isn't fully merged, sowt's mark-then-Ddelete flow previously just failed for such branches with no path to actually remove them.gitdata.Collectnow detects merge status per branch (viagit branch --merged) and sets a newItem.Unmergedflag.D→Enter) no longer deletes immediately. Instead it opens a second screen listing the unmerged branch(es) that requires typing the exact phrase "Yes, I want to remove the branch that has changes that have been unmerged." before proceeding.Esc/Ctrl-Ccancels the whole batch without touching Git state.git branch -dfor merged branches,git branch -D(force) for unmerged ones.Why
wtcurrently offers no way at all to delete a branch with unmerged commits; the delete just errors out. This adds that capability behind deliberate friction (an exact typed phrase) so it can't happen by accident.Test plan
go vet ./...,go build ./...,go test ./...all passinternal/gitdata,internal/ui,internal/actioncovering merge detection, the new confirm mode (wrong phrase, exact phrase, cancel, backspace, mixed merged/unmerged batches), and the-Dforce-delete pathTestIntegrationDeleteUnmergedBranchRequiresForcePhrase) drives a real repo through mark →D→Enter→ typed phrase →Enterviateatestand confirmsgit branch -Dactually removes the branchSPEC.mdandREADME.mdupdated to document the new screen🤖 Generated with Claude Code