🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #293

Re: [PATCH v2 0/2] branch: let --delete-merged find squash merged branches

#293
From: Junio C Hamano
Date: Mon, 12 Oct 2026 00:30
45 lines
11875 bytes
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> 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).

Interesting.

After rebasing, you probably can (re)use the same algorithm as used
in range-diff to match the commits and their rewritten counterparts,
but I wonder how "squash" would go.  Presumably you can locally make
a trial squash merge and probe for a similar commit on the upstream
commit.

On the other hand, unlike deliberate rebasing done during a patch
iteration, rebase done on the upstream to integrate your changes
would not rewrite the log messages, so matching the commits based on
the log message may work better than a range-diff between iteration
vN and v(N+1) in the submitted patches.

>  * 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

This a bit unexpected two-patch organization; I would have expected
that the cases where our side and upstream side should correspond
one-to-one (i.e., what you call rebase-and-merge) and other cases
(i.e., squash merge) to require very different matching algorithm,
which would lead to two-patch organization where one adds support
for rebase and the other adds support for squash.
Technical Details
Message-ID: <xmqq1p9vdalz.fsf@gitster.g>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71719-linux-kernel-git=dewy.ru
References: <pull.2425.git.git.1790667030497.gitgitgadget@gmail.com> <pull.2425.v2.git.git.1791711665.gitgitgadget@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71719-linux-kernel-git=dewy.ru
From: gitster@pobox.com (Junio C Hamano)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2 0/2] branch: let --delete-merged find squash merged
 branches
Date: Sun, 11 Oct 2026 17:30:00 -0700
Organization: Usenet Network
Message-ID: <xmqq1p9vdalz.fsf@gitster.g>
References: <pull.2425.git.git.1790667030497.gitgitgadget@gmail.com>
	<pull.2425.v2.git.git.1791711665.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: usenet.network;
	logging-data="1648292"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:baJu8xcg3Gkz0ll7KX34X1DLPgg= sha256:JWSkgVTUZipo7j6mYPGcMn0bk1xmzg/KxhlhPt6ztKk=
	sha1:jgwcwf9NVJvVRujEdhi61fm9MsU= sha256:5WFvDV2xQ+DJZdVbnZ1ecwsu36qdl/ijMkBnlQJ3emE=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 109D510FAA1; Mon, 12 Oct 2026 03:30:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=pobox.com header.b=kfKO8Vuu; dkim=pass (2048-bit key)
	header.d=messagingengine.com header.b=ptbJHRH3
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id jc0nckN8YlcJ;
	Mon, 12 Oct 2026 03:30:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-71719-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=pobox.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 2ED6C10FA9E; Mon, 12 Oct 2026 03:30:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 2D7C73206B; Mon, 12 Oct 2026 00:30:08 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id BD55D25F7B9;
	Mon, 12 Oct 2026 00:30:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="kfKO8Vuu";
	dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ptbJHRH3"
X-Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF10723A561
	for <git@vger.kernel.org>; Mon, 12 Oct 2026 00:30:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791765006; cv=none; b=Qvzw/FP77leTolc6/Hb1nL596ktN9bECzBG0g+tS6xmZKoGNyf+lYplpYW0IF20fe2PlNisuMK0TCYt2vRbdgmelG/mPSBh2PPP1VPZF2uqB7pmruUYkNuG8yzqv4W7LWity5Ar/ibpgRY33i5AxoK6iPOIEJyM5gvod9oWt4Cg=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791765006; c=relaxed/simple;
	bh=ZzCepFLwv48tii+ckxNQ1DlHLLVVKgwQy/l/JeBzjm0=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=Y1KrDPl2L3NkWICxLVJo0qp0WXp2jrNe62JTAmB3zrlHj0aocPpebrx2UO00XOAaZ+5g0n6KxNTvqAzyZShm2kjd+ERK/Z3weT13B1y14HdQM5TMMXWLs5behYYbhe2Y1sc4cZnM7gXFfGC4sECrUH3xzHJu4C8SZjKCJs4f+K0=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=kfKO8Vuu; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ptbJHRH3; arc=none smtp.client-ip=202.12.124.147
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com
X-Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43])
	by mailfout.stl.internal (Postfix) with ESMTP id E988B1D0006C
	for <git@vger.kernel.org>; Sun, 11 Oct 2026 20:30:03 -0400 (EDT)
X-Received: from phl-frontend-02 ([10.202.2.161])
  by phl-compute-03.internal (MEProxy); Sun, 11 Oct 2026 20:30:03 -0400
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc
	:cc:content-type:content-type:date:date:from:from:in-reply-to
	:in-reply-to:message-id:mime-version:references:reply-to:subject
	:subject:to:to; s=fm1; t=1791765003; x=1791851403; bh=5lUDRg2jK4
	uPqkEdI8gYWYka0/iNKIgGVYpnSSrCeS4=; b=kfKO8VuuKXVTLezyXWt20df24p
	Zq1XREs118DslPgQj+bkSCAnSMk/82jufQ85eTJ6rug+4jYCtGn4L0JpEVi26WWg
	7Xv0dOlIgTZMhC60+zZH4boFgQSRU8hy2U9RQU1id3xaUmGJ/x8LFq3C7jdP3izx
	LA9dMU1pQTib4d2edLdvNi6ogOlOYG5dJNnQscQ7yg0XGSIcxJeCTasBvi0hS2n6
	HDbTQeO1DYMBWheBI+u5V3FEPFTbwb3sDwrTRuG9nfCu86csU/ggjQ4mlZATQ5pu
	AhD/HNqmcQaRCrZuaYJy10exQLgVzO99qRJ99Q6oPkeE3V5As/5Pz9DnX3AQ==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1791765003; x=1791851403; bh=5lUDRg2jK4uPqkEdI8gYWYka0/iNKIgGVYp
	nSSrCeS4=; b=ptbJHRH3btQkJhXLPxU+OiYWCxIHI/XK6fhXq+GJcdc8oTCWfeq
	WJ2wD3+XGW7cB4VlAfLkqdlDNPDSjZDLk6EE3gCI+WT/6Xx9lqUV+1JwQH7vLz1w
	vafXpzCkH7Y330kiAGNu55In764stozGRwy7xtSSYGXCjCKaAtBnYOE3QfxMqv0y
	huJoSIhXzJK+6H3IygtHkR2iSjstMnMZm8eHK6t4KICJqGU+P+CvP8VokJ6Vjfs9
	sSrAKRbaM8HO+5F+UoBYbUlurk6dXuAPD4ESUtGFLxPcEMlUQibpTDPMafeDQ7z1
	HSYCljZ8qd4zLZ9lOjEG5HMtZKmbAc1DFpw==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06;
	repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox;
	action=sign d=pobox.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1791765003; d=pobox.com;
	mf=PGdpdHN0ZXJAcG9ib3guY29tPg==;
	rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+;
	s=fm1:rsa-sha256:KktfnZasYMd86CK6kZW3FrKeiRx0cb6KKeFoJ8oCTvR2Il8
	1M5MhOCvOPuenmvwttufa+EnTR0UT3eeGC5uvdbuSVhvSZKbGCTBwIwCvXgQu2co
	ph3OTbA6K/pDhiwlkBqulTkPTVZFbakxSjpMaQLrrjbtxrWb74kgZhrR8U2kBKbf
	5NkvEwIV1TY1M2EtrOfgaT/rgcWh3icS8PU5NuVeNNvDhPuLFoRJkvyhRJRxVSFV
	ouQWSmH5G2ZirldRAyRRsRIQ+9S3jBGdo3/xRLjKwve4o3ywACT1lfYRxoD5zLSO
	nK8JIdAb9EejYRjDsE7TNpQUk7JPBQUTnpM7c8w==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06;
	repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox;
	action=mi-m=1; hc=12;
	hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id,
	mime-version,references,subject,to,user-agent;
X-Message-Instance: m=1; h=sha256:nKv6iNLy9f46OzTBWzZ/1BYIDRytIL5RqVD2E35z154=:ZzCepFLwv48tii+ckxNQ1DlHLLVVKgwQy/l/JeBzjm0=;
X-ME-Sender: <xms:CyrMaljkDqvCiUX6c4XCtwYQnkdz7M6K1Ym8tvPTD7wPpK58HyBNug>
    <xme:CyrMasRNbAYM4yC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izRZA>
    <xmx:CyrMam70zvtHgI4VYrGUBRC_9Pz5W1CpqdsgcVP-S6f3CiaTm83gFw>
    <xmx:CyrManhC-1O1yOs1EjbUCdAal38QC8Mkw4XNsese8nA_9NPZ37Dp8w>
    <xmx:CyrMajE-gH9owmH0XVX1-gdRcaYV5E0ru2hjPwymNJ4EBnMV-ECChj05>
X-Feedback-ID: if26b431b:Fastmail
X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 11 Oct 2026 20:30:02 -0400 (EDT)
X-Cc: git@vger.kernel.org,  Kristoffer Haugsbakk
 <kristofferhaugsbakk@fastmail.com>,  "D. Ben Knoble"
 <ben.knoble@gmail.com>,  Phillip Wood <phillip.wood123@gmail.com>,  Harald
 Nordgren <haraldnordgren@gmail.com>
X-In-Reply-To: <pull.2425.v2.git.git.1791711665.gitgitgadget@gmail.com> (Harald
	Nordgren via GitGitGadget's message of "Sun, 11 Oct 2026 09:41:03
	+0000")
X-User-Agent: Gnus/5.13 (Gnus v5.13)
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>