Harald Nordgren's series addresses branches integrated upstream by squash merge, rebase or cherry-pick, such as GitHub's "Squash and merge" and "Rebase and merge". Their tips are not reachable from upstream, so git branch --delete-merged never removes them. The patch treats a branch as merged when some upstream commit since the fork point contains all its changes, and prints that commit, for example "Deleted branch topic (was 1a2b3c4, landed as 9f8e7d6)".
In v2, each upstream commit is diffed once and the result is shared between all branches, which Harald says is faster than v1. It also fixes a bug where a branch merged with a merge commit was reported as "landed as" the merge when another branch was searched first, and adds a test for that case.
A follow-up patch adds --no-squashed, which restricts deletion to branches whose tip is reachable from upstream. Harald explains that the search makes the command slower and in a partial clone may download blobs, and that users otherwise have no way to skip it.
Junio C Hamano called the idea interesting and suggested that the range-diff matching algorithm might be reusable to pair commits with their rewritten counterparts. He wondered how squash would work, and suggested that a trial squash merge could be made locally and probed against upstream commits. He also noted that rebases done on the upstream side usually leave log messages unchanged, so message-based matching might work better than a range-diff between patch iterations.
Kristoffer Haugsbakk, D. Ben Knoble and Phillip Wood also took part in the thread, but their comments are not in the excerpts.