Re: [PATCH v4 0/4] branch: let --delete-merged find squash merged branches
- From
- Jasper Mayone <me@jaspermayone.com>
- Date
- Oct 29, 2026, 04:30 UTC
- Message-ID
- <20261029043041.5994-1-me@jaspermayone.com>
- In-Reply-To
- <pull.2425.v4.git.git.1793003627.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Changes in v4: > > * --delete-merged works as it does on master again: it only deletes > branches whose tip is reachable from their upstream
Thanks. I ran v4 (19a9630c13) on the same generated repositories as before, against master (7e34d8174d). t3200 passes.
--delete-merged now gives exactly the same result as master on every case, including the branch that was never merged but whose change another author made upstream. That one is kept.
--delete-integrated deletes the squash merges, the GitHub-style squash, the rebase merge, the rename, the squash that was later reverted, and a squash that landed after upstream changed another line of the same file. "landed as" names the correct commit each time. It keeps a branch whose work only partly landed, a cherry-pick whose conflict was resolved differently, and the never-merged branches with an empty or net-zero diff. As the documentation says, it deletes the branch whose change another author made, which is fine now that the user has to ask for it.
Three small things:
* "git branch -h" does not show --delete-integrated in the usage lines, although the SYNOPSIS in git-branch.adoc has it.
* Giving both --delete-merged and --delete-integrated dies with the full usage text. A short "cannot be used together" message would be clearer.
* The cover letter still says "--squashed" in the second paragraph, and "--delete-irrelevant" in the list of changes.
A branch checked out in a worktree is still skipped with no message, with both options.
Tested-by: Jasper Mayone <me@jaspermayone.com>
Thanks, Jasper