Repository navigation
pr-git-2425/HaraldNordgren/branch-delete-squashed-v2
tagged this
11 Oct 09:41
Branches merged on GitHub with "Squash and merge" or "Rebase and merge" are never deleted by git branch --delete-merged, because their tips are not reachable from the upstream. This treats such a branch as merged when some upstream commit contains all of its changes, and names that commit in the output: Deleted branch topic (was 1a2b3c4, landed as 9f8e7d6). Changes in v2: * Diff each upstream commit once and share the result between all branches, faster than v1. * Fix a branch merged with a merge commit being reported as "landed as" the merge when another branch was searched first, and add a test for it. Show the topic commit itself in "landed as" for work that arrived through a merge. * Use git merge --squash as the example in the commit message and mention GitHub's squash and rebase buttons. * Add --no-squashed to skip the squash search. Harald Nordgren (2): branch: let --delete-merged find squash merged branches branch: add --no-squashed to skip the squash search Documentation/git-branch.adoc | 23 ++- builtin/branch.c | 342 ++++++++++++++++++++++++++++++++-- t/t3200-branch.sh | 170 +++++++++++++++++ 3 files changed, 509 insertions(+), 26 deletions(-) base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd Submitted-As: https://lore.kernel.org/git/pull.2425.v2.git.git.1791711665.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2425.git.git.1790667030497.gitgitgadget@gmail.com