From: Matt Hunter Date: Tue, 03 Nov 2026 01:56:59 GMT Subject: Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits Message-ID: In-Reply-To: <427F4BDB-B21B-468E-9C6A-4A7FE3F13688@gmail.com> On Mon Nov 2, 2026 at 8:10 PM EST, Ben Knoble wrote: >> Le 2 nov. 2026 à 19:16, Junio C Hamano a écrit : >> >> I thought Harald's case was to take the patches from the previous >> round of the topic and rebase them on top of a different base (e.g., >> updated origin/master), so there is no suitable single for >> the three-rev form, but I may have misunderstood his example. > > I think origin..old-topic and origin..new-topic > would both select only the “topic” commits as long as both > bases are reachable from origin (which seems to be the > described case, to me). Put another way, every commit reachable from origin is excluded from either side of the range-diff. Harald's example uses the symmetric difference syntax. I think this effectively treats the merge-base of the two tips as the shared base in the range-diff. It can't tell the difference between new commits that are part of the topic and ones that are only there by virtue of advancing the topic's (real) base. So, I think this ... form would yield the expected output if you only rewrote history in-place _on the same base commit_, but not in the general case? > > I agree with Matt that better selection of inputs to range-diff > makes this specific case better :) When I run this command, I almost always say it like this (with the topic checked out) git range-diff master @{1} @ ^ or, @{u} depending on the workflow