Article View: linux.kernel.git
Article #2172Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
From: Ben Knoble
Date: Mon, 02 Nov 2026 16:47
Date: Mon, 02 Nov 2026 16:47
71 lines
14005 bytes
14005 bytes
> Le 2 nov. 2026 à 05:11, Harald Nordgren <haraldnordgren@gmail.com> a écrit :
>
> On Mon, Nov 2, 2026 at 10:21 AM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>
>>> From: Harald Nordgren <haraldnordgren@gmail.com>
>>>
>>> Reviewing a range-diff often means scrolling past commits that were
>>> simply added or dropped, when only the ones that correspond between
>>> the two ranges are of interest.
>>>
>>> --left-only and --right-only already each suppress one of those
>>> one-sided groups, but they are defined as "only show this side" and
>>> so cannot be given together, which is exactly why show_range_diff()
>>> already rejected that combination. Give the "show only the commits
>>> that correspond on both sides" behavior its own name, --matched-only,
>>> instead of asking users to reach for a combination that errors out.
>>>
>>> Extend the existing '--left-only'/'--right-only' conflict check to
>>> also reject any combination with --matched-only, since all three
>>> narrow the output in ways that cannot be combined.
>>>
>>> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
>>> ---
>>> range-diff: add --matched-only to skip one-sided commits
>>>
>>> Add git range-diff --matched-only to only show commits that correspond
>>> between the two ranges, skipping ones that were only added or only
>>> removed.
>>>
>>> Changes in v2:
>>>
>>> * Update docs and commit message.
>>> * Use die_for_incompatible_opt3.
>>
>> This is more than 6 weeks old and looking at the archive, nobody
>> (including me) was really interested in the topic. Anybody wants to
>> take a fresh look at the topic?
>>
>> Unless we see some volunteers to give it a review in a few weeks, I
>> will discard the topic out of my tree, as 'seen' has been crowded
>> with topics that have been collecting dust without getting many
>> reviews.
>
> That's a bit sad. I wonder if no one is commenting on it because the
> code is too trivial, meaning nothing that stands out to comment on.
> All it does is allow left_only and right_only to run at the same time,
> and the majority of the new code is tests.
>
>
> Harald
I just skimmed the v3 message, and I’m missing the motivation.
When looking at a range-diff, why would I want to hide the added/deleted
commits?
I suppose when rebasing, I might want to not show the dropped
fixup commits or something in a range-diff of @{1}…, but
I’m having a hard time coming up with another use case.
Doesn’t mean there aren’t any! [But the patch might get more
and better reviews if it is well motivated?] Anyway, I’d be curious
to learn what motivated Harald, as it might be useful to my
own workflows, in which case I might be able to review more.
Technical Details
Message-ID:
<73E9A266-5224-43CC-ABC4-83FBC6B77F13@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74193-linux-kernel-git=dewy.ruReferences:
<CAHwyqnVtN79Y7SAWb4YFRCqCO6+Jq9-9tZ9Jho4ec8pjVJR00Q@mail.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-74193-linux-kernel-git=dewy.ru
From: ben.knoble@gmail.com (Ben Knoble)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
Date: Mon, 2 Nov 2026 11:47:09 -0500
Organization: Usenet Network
Message-ID: <73E9A266-5224-43CC-ABC4-83FBC6B77F13@gmail.com>
References: <CAHwyqnVtN79Y7SAWb4YFRCqCO6+Jq9-9tZ9Jho4ec8pjVJR00Q@mail.gmail.com>
MIME-Version: 1.0 (1.0)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="3013369"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:4nF1b1jeCAwkHS88FX5kMS8OJ0U= sha256:cRkCfYqTMRbpyxvpfgQJ9yRN8LBNvrxjXFHi4VMy2FA=
sha1:gYLdyVtWrd/V9OotrUoo3mtQEvQ= sha256:uwRV+kUqoMzj7uCUnFwj6Ecc6fqi7A41bVKLuNmZ5Ko=
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 5F947112642; Mon, 2 Nov 2026 22:32:42 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, MIME_QP_LONG_LINE=0.001,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
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 CByRTpeDebsr;
Mon, 2 Nov 2026 22:32:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-74193-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 9C4B411261F; Mon, 2 Nov 2026 22:32:24 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 647BF35812; Mon, 2 Nov 2026 17:22:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793638042;
b=EZ291pu+EHD2++or5Wa3EPy/BuoYXek0aD+7pkoOHTvxowXujfj8RrHpYPdvcXstSn4u
91vKgb2wnGRK38r7O/Zc7JpcpM7aLl91C6gAzRUQlnYJ6RjFm3Jg0+Gl9JHn6f3FLyyt6
XYSAib/mAkMicatvgsaRf6o/E87S/IU1lCnHzx1TiqYrA+eX/TfghFooW9yI3c3zH4rI+
NvAFU+CdkxtDY4zn3NWpyAra3wuXkWhYMwY59BlXP007tGWilWwwByQF7LEpWiXEw4rQF
8zAY2lVnfvh9klDNzwKvyy2iPzCWcRDxIWgQJSkjXch4LsMNO6FcTBT0wDbwt5ks9yA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793638042;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:Content-Type:Content-Transfer-Encoding:
From:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:Mime-Version:Subject:Date:
Message-Id:References:Cc:In-Reply-To:To:X-Mailer;
bh=bm7JU63ozMmtE8z9v3s+3IRlcOCdgZccS3kBxhWhVHQ=;
b=OAcnUds8VkNiFKUI0fqjasYJo4ypn7Cu9gCeiUat5L/4wiHYyJXyWHRbY5gtyLyG3Ulh
Ix/TRjcLlH8CuLutxULO5tI6o127DFOLq+FF9/jrmTqh/eCuJkmwHJLQ+K3S1IFRJ7p41
VtcK01Uy94RcSqzEmIBopYR15LLB2a1sLWlDQJGPMjXaikQDKFTaI7cjkF+LxoAfjfi96
rKemlxGWoIduvRHaoRumt9ZemrJVbvJwT6nOV7m3wSn/1hWx7Syzw60ApMgEdofd226q0
WBa8ErtIB7eRpbiT78bNGTISMiYJWaB6FeS9hJQqqV0Z1kQgYpftR4u4tXYEVkedZ8g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=S1HjKiL9;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id C2556606B1D5;
Mon, 2 Nov 2026 16:47:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=S1HjKiL9
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793638041;
b=RdA9mtO9/D6zn5SN/VwfRYrIMedYXTBw/eyQD6E391htdzbb52ouMuKe/P2sTLvuiYXE
Ng4NzIKVQonSLQFBf5nZ5Gr+hmUnFvY7iQlY8uLlkMyrfBRjcVc8QKNZ+1J45WAU50/jR
gYOb7Izc8wOhmOiF5vvFjqjvw6++iSHKuLOg8flqHbyJuww0Kz/K92njMLs/SwDBLe9Uh
JqBk9gZM5bnKBjgUuEy5U6glswpsd6YOIC34YHkmaOCHwPEjt20npnVD/4eAvOCaZr0JG
JaPVSo27+GZwhhcD04fjF/x0LnnyKynN61BlTTQzYSjOJLUwQI6qJiEExN0aDjGiCSA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793638041;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Content-Type:Content-Transfer-Encoding:From:Mime-Version:Subject:Date:
Message-Id:References:Cc:In-Reply-To:To:X-Mailer;
bh=bm7JU63ozMmtE8z9v3s+3IRlcOCdgZccS3kBxhWhVHQ=;
b=zaspgBVGNTeiUqTh6JGMmFQLcUSQjyIaH/Pb77/kd//l4cLgQHPVxwOIuBhvuZrexnoh
Sr2mEfz4ZYstfpdsneI5F2dXO0aT5tWisR19xBADouc1qpQfAeZHk7LZZWJ8/1mpn3IpX
k5Mo7uof7ol4wmwtGpJa/2pkih5qzeqOqhzB3qfsUG56Qwo847/PnS0VYzW3n/L2Bpl1Q
ASkPGZTuB9UQDwBhuTgfzFfcTve1WEeNsknxFoDZEZMg/SihxhKoZTVmiYDIm0izUMj4x
hgKDpqXdcSPACKA4EuKEOFUnd3e8rKCkX9Qb6vn66J3yMRvK1J7AHHihHHGrIv0WUoQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=S1HjKiL9;
arc=none smtp.remote-ip=209.85.128.178
X-Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96C73606B0E9
for <git@vger.kernel.org>; Mon, 2 Nov 2026 16:47:21 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96C73606B0E9
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-8b12b1ee403so18429907b3.2
for <git@vger.kernel.org>; Mon, 02 Nov 2026 08:47:21 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793638040; x=1794242840; darn=vger.kernel.org;
h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
:from:content-transfer-encoding:content-type:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=bm7JU63ozMmtE8z9v3s+3IRlcOCdgZccS3kBxhWhVHQ=;
b=S1HjKiL9ockCSSVf0rHw5NZghERfutjM/AkTUUpIdi1L6OTfGkxkKyKrqDdqI2X01K
K873GQ9/wNRXWUArN2iPAlvEpJTsW9fJJvWwECXhcxBN3Y4xzYinbQmJ9NGN76xaQ6JL
leWwi2W2q/aRZJ4davJsCPnUpYbr4nO6Woi8SuSS9l1NlDvtZYQHCew7QfWeMu1bO7ct
3uXpqFv5X6IFY8+FQqvW1m+dU2+gdkmRPCyKuC/FExCqmy/itBk6v0ydHqQcsRCsNn6q
XrhgCETM6+LVliGzWr61APTupczrkr/p3BRKhbiJKRV8MmDKrZ0oj2tbfD62qeKRUnai
s3gg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793638040; x=1794242840;
h=to:in-reply-to:cc:references:message-id:date:subject:mime-version
:from:content-transfer-encoding:content-type:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=bm7JU63ozMmtE8z9v3s+3IRlcOCdgZccS3kBxhWhVHQ=;
b=ieGu51MEEN+udoIktlmwYOoDJCalBz801WcHtEZhuE1aEtHY+fJ+E4qIq6lkuxVb8p
4+L9vPZNqukn80+s7sN9mg0uXnxFC2pC/Peew7XndxJRAlPLiXFUiTx87zId5AmHEH/z
Ug3YCaEAVANl7tbJpMXoWLzUJ0rbnDc3pysVgoljfi8qvk/WPBgw3ZFKcC3uXoKR8TVN
021L9eqsJuoL/0D5RgfHhW9+0jC68EsKK3GhcLbkxQMTAL0pcqNLQXfMi1pCvFAQHT63
VWfKIc1mRw/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+oPNXjSNU
X-Received: by 2002:a05:690c:6e83:b0:8b0:e680:6157 with SMTP id 00721157ae682-8b2b6774208mr67770237b3.39.1793638040544;
Mon, 02 Nov 2026 08:47:20 -0800 (PST)
X-Received: from smtpclient.apple ([2605:a601:9d46:600:753f:c392:a7d3:dbf])
by smtp.gmail.com with ESMTPSA id 00721157ae682-8b2b7123fd9sm56557807b3.12.2026.11.02.08.47.19
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 02 Nov 2026 08:47:20 -0800 (PST)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org,
Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>
X-In-Reply-To: <CAHwyqnVtN79Y7SAWb4YFRCqCO6+Jq9-9tZ9Jho4ec8pjVJR00Q@mail.gmail.com>
X-Mailer: iPhone Mail (23D8133)