git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Nov 4, 2026, 11:25 UTC
Message-ID
<62095245-8121-4698-b1aa-ff239286d9e9@app.fastmail.com>
In-Reply-To
<427F4BDB-B21B-468E-9C6A-4A7FE3F13688@gmail.com>
On Tue, Nov 3, 2026, at 02:10, Ben Knoble wrote:
Show 27 quoted lines
>> Le 2 nov. 2026 à 19:16, Junio C Hamano <gitster@pobox.com> a écrit :
>>
>> "Matt Hunter" <m@lfurio.us> writes:
>>
>>> Wouldn't invoking as
>>>
>>>    git range-diff origin/master
>>>        pr-git-2401/HaraldNordgren/range-diff-matched-only-v3
>>>        range-diff-matched-only
>>>
>>> address this case?
>>
>> Three-rev form where <base> and two evolutions <rev1> and <rev2> are
>> given, and <base>..<rev1> and <base>..<rev2> are compared?
>>
>> 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 <base> 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).
>
> I agree with Matt that better selection of inputs to range-diff
> makes this specific case better :)
I use the
     base..old base..new

Form as well.[1] Then it indeed does not matter if you have rebased or not, as far as unrelated commits are concerned. You won’t get unrelated commits.

But I don’t rebase topics here since I was told to not do it unless it is needed. And also because then I get to use the often more readable `--interdiff` output as well.

† 1: The repetition seems a bit inevitable and annoying, but I use a
     script for assembling all of the options to git-format-patch(1).
Previous: Junio C HamanoNext: Ben Knoble
Message 20 of 23 in “range-diff: add --matched-only to skip one-sided commits”
  1. range-diff: add --matched-only to skip one-sided commitsHarald Nordgren via GitGitGadget, Sep 11, 2026
  2. Junio C HamanoSep 11, 2026
  3. Harald NordgrenSep 11, 2026
  4. Junio C HamanoSep 11, 2026
  5. Harald NordgrenSep 11, 2026
  6. Junio C HamanoSep 11, 2026
  7. range-diff: add --matched-only to skip one-sided commitsHarald Nordgren via GitGitGadget, Sep 11, 2026
  8. Junio C HamanoSep 14, 2026
  9. range-diff: add --matched-only to skip one-sided commitsHarald Nordgren via GitGitGadget, Sep 15, 2026
  10. Junio C HamanoNov 2, 2026
  11. Harald NordgrenNov 2, 2026
  12. Ben KnobleNov 2, 2026
  13. Harald NordgrenNov 2, 2026
  14. Harald NordgrenNov 2, 2026
  15. Matt HunterNov 3, 2026
  16. Junio C HamanoNov 3, 2026
  17. Ben KnobleNov 3, 2026
  18. Matt HunterNov 3, 2026
  19. Junio C HamanoNov 3, 2026
  20. Kristoffer HaugsbakkNov 4, 2026
  21. Ben KnobleNov 4, 2026
  22. Kristoffer HaugsbakkNov 4, 2026
  23. Junio C HamanoNov 2, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.