🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.git
14 messages
14 total messages Started by Junio C Hamano Mon, 02 Nov 2026 09:21
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2118
Author: Junio C Hamano
Date: Mon, 02 Nov 2026 09:21
43 lines
14356 bytes
"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.

Thanks.
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2125
Author: Harald Nordgren
Date: Mon, 02 Nov 2026 10:05
53 lines
13810 bytes
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
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2172
Author: Ben Knoble
Date: Mon, 02 Nov 2026 16:47
71 lines
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.
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2184
Author: Harald Nordgren
Date: Mon, 02 Nov 2026 21:03
149 lines
17946 bytes
On Mon, Nov 2, 2026 at 5:47 PM Ben Knoble <ben.knoble@gmail.com> wrote:
>
>
> > 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.

For me, it's simple:

If we take this branch, and I do some other changes, and then rebase
against the latest master. Then when I run

    git range-diff
pr-git-2401/HaraldNordgren/range-diff-matched-only-v3...range-diff-matched-only

I will have to scroll through 311 unrelated commits before I can see
what I actually changed. I want those gone.

```
  -:  ---------- > 282:  b2608c4076 t2104: avoid suppressing git's exit code
  -:  ---------- > 283:  5e106cb22b pack-write: make index-pack output
comment hash agnostic
  -:  ---------- > 284:  21bb64feef pack-write: lift and expose
index-pack report parsing
  -:  ---------- > 285:  dfb7f49776 object-file: explicitly write
".keep" lockfile
  -:  ---------- > 286:  b07099fff9 object-file: write ".keep"
lockfiles during transaction commit
  -:  ---------- > 287:  91ef176b8f branch: strip refs/heads/ from the
--set-upstream-to hint
  -:  ---------- > 288:  8f3d6ad89f checkout: use Q_() for messages with counts
  -:  ---------- > 289:  7e34d8174d The 8th batch
  -:  ---------- > 290:  4ec5266711 branch: return an error from
setup_tracking()
  -:  ---------- > 291:  ad74e02417 checkout: finish switching when
the tracking config cannot be written
  -:  ---------- > 292:  d84678b8cf Documentation: describe
connectivity checking
  -:  ---------- > 293:  97998dcfd1 p5413: add perf tests for connectivity check
  -:  ---------- > 294:  d6d2d8557c connected: drop dependency on
`the_repository`
  -:  ---------- > 295:  9e0207b50b connected: add
transfer.connectivityCheck config
  -:  ---------- > 296:  43157175b5 connected: add incremental
connectivity check via rev-list
  -:  ---------- > 297:  656be5948a connected: add "auto" connectivity
check mode
  -:  ---------- > 298:  9dba0b87e5 rerere: stop using
`the_repository` in `rerere_path()`
  -:  ---------- > 299:  f62947adf0 rerere: stop using
`the_repository` in internal helpers
  -:  ---------- > 300:  a8b75e8eda rerere: remove redundant calls to
`repo_config()`
  -:  ---------- > 301:  87ab289605 rerere: cache result of
`is_rerere_enabled()`
  -:  ---------- > 302:  4f67f74fc8 rerere: stop using `the_repository`
  -:  ---------- > 303:  ea54cda7c2 rerere: bundle global state into a struct
  -:  ---------- > 304:  b948c10c8b rerere: get rid of global rerere cache state
  -:  ---------- > 305:  c3764d15e6 hook: make hook.<event>.enabled
cover the hookdir hook
  -:  ---------- > 306:  3a7784d0d5 hook: accept .enabled and
.parallel given without a value
  -:  ---------- > 307:  37b3475fb5 The 9th batch
  -:  ---------- > 308:  8d1b215c01 The 10th batch
  -:  ---------- > 309:  b9e5cff180 The 11th batch
  -:  ---------- > 310:  50fe5cc63f The 12th batch
  -:  ---------- > 311:  ebdc087dc9 The 13th batch
  1:  ee195c14fc = 312:  f01d7e30ef range-diff: add --matched-only to
skip one-sided commits
```



Harald
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2191
Author: Harald Nordgren
Date: Mon, 02 Nov 2026 21:15
163 lines
18495 bytes
Well, in this particular case `--left-only` solves it.

So maybe that's enough.


Harald

On Mon, Nov 2, 2026 at 10:03 PM Harald Nordgren
<haraldnordgren@gmail.com> wrote:
>
> On Mon, Nov 2, 2026 at 5:47 PM Ben Knoble <ben.knoble@gmail.com> wrote:
> >
> >
> > > 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.
>
> For me, it's simple:
>
> If we take this branch, and I do some other changes, and then rebase
> against the latest master. Then when I run
>
>     git range-diff
> pr-git-2401/HaraldNordgren/range-diff-matched-only-v3...range-diff-matched-only
>
> I will have to scroll through 311 unrelated commits before I can see
> what I actually changed. I want those gone.
>
> ```
>   -:  ---------- > 282:  b2608c4076 t2104: avoid suppressing git's exit code
>   -:  ---------- > 283:  5e106cb22b pack-write: make index-pack output
> comment hash agnostic
>   -:  ---------- > 284:  21bb64feef pack-write: lift and expose
> index-pack report parsing
>   -:  ---------- > 285:  dfb7f49776 object-file: explicitly write
> ".keep" lockfile
>   -:  ---------- > 286:  b07099fff9 object-file: write ".keep"
> lockfiles during transaction commit
>   -:  ---------- > 287:  91ef176b8f branch: strip refs/heads/ from the
> --set-upstream-to hint
>   -:  ---------- > 288:  8f3d6ad89f checkout: use Q_() for messages with counts
>   -:  ---------- > 289:  7e34d8174d The 8th batch
>   -:  ---------- > 290:  4ec5266711 branch: return an error from
> setup_tracking()
>   -:  ---------- > 291:  ad74e02417 checkout: finish switching when
> the tracking config cannot be written
>   -:  ---------- > 292:  d84678b8cf Documentation: describe
> connectivity checking
>   -:  ---------- > 293:  97998dcfd1 p5413: add perf tests for connectivity check
>   -:  ---------- > 294:  d6d2d8557c connected: drop dependency on
> `the_repository`
>   -:  ---------- > 295:  9e0207b50b connected: add
> transfer.connectivityCheck config
>   -:  ---------- > 296:  43157175b5 connected: add incremental
> connectivity check via rev-list
>   -:  ---------- > 297:  656be5948a connected: add "auto" connectivity
> check mode
>   -:  ---------- > 298:  9dba0b87e5 rerere: stop using
> `the_repository` in `rerere_path()`
>   -:  ---------- > 299:  f62947adf0 rerere: stop using
> `the_repository` in internal helpers
>   -:  ---------- > 300:  a8b75e8eda rerere: remove redundant calls to
> `repo_config()`
>   -:  ---------- > 301:  87ab289605 rerere: cache result of
> `is_rerere_enabled()`
>   -:  ---------- > 302:  4f67f74fc8 rerere: stop using `the_repository`
>   -:  ---------- > 303:  ea54cda7c2 rerere: bundle global state into a struct
>   -:  ---------- > 304:  b948c10c8b rerere: get rid of global rerere cache state
>   -:  ---------- > 305:  c3764d15e6 hook: make hook.<event>.enabled
> cover the hookdir hook
>   -:  ---------- > 306:  3a7784d0d5 hook: accept .enabled and
> .parallel given without a value
>   -:  ---------- > 307:  37b3475fb5 The 9th batch
>   -:  ---------- > 308:  8d1b215c01 The 10th batch
>   -:  ---------- > 309:  b9e5cff180 The 11th batch
>   -:  ---------- > 310:  50fe5cc63f The 12th batch
>   -:  ---------- > 311:  ebdc087dc9 The 13th batch
>   1:  ee195c14fc = 312:  f01d7e30ef range-diff: add --matched-only to
> skip one-sided commits
> ```
>
>
>
> Harald
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2188
Author: Junio C Hamano
Date: Mon, 02 Nov 2026 22:01
23 lines
13588 bytes
Harald Nordgren <haraldnordgren@gmail.com> writes:

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

That would be an ideal case.

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

One of the more crucial questions that the above does not answer,
which very often gets missed by AI review bots, is "does allowing
them to run at the same time make sense in the first place?"
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2198
Author: "Matt Hunter"
Date: Tue, 03 Nov 2026 00:01
43 lines
9412 bytes
On Mon Nov 2, 2026 at 4:15 PM EST, Harald Nordgren wrote:
>> On Mon, Nov 2, 2026 at 5:47 PM Ben Knoble <ben.knoble@gmail.com> wrote:
>> >
>> > 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.
>>
>> For me, it's simple:
>>
>> If we take this branch, and I do some other changes, and then rebase
>> against the latest master. Then when I run
>>
>>     git range-diff
>> pr-git-2401/HaraldNordgren/range-diff-matched-only-v3...range-diff-matched-only
>>
>> I will have to scroll through 311 unrelated commits before I can see
>> what I actually changed. I want those gone.
>>
>> ```
>>   -:  ---------- > 282:  b2608c4076 t2104: avoid suppressing git's exit code
>>   -:  ---------- > 283:  5e106cb22b pack-write: make index-pack output
>> comment hash agnostic
>>   [...]
>>   -:  ---------- > 311:  ebdc087dc9 The 13th batch
>>   1:  ee195c14fc = 312:  f01d7e30ef range-diff: add --matched-only to
>> skip one-sided commits
>> ```
>>
> Well, in this particular case `--left-only` solves it.
>
> So maybe that's enough.

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?
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2199
Author: Junio C Hamano
Date: Tue, 03 Nov 2026 00:16
18 lines
13443 bytes
"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.
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2202
Author: Ben Knoble
Date: Tue, 03 Nov 2026 01:10
30 lines
12029 bytes
> 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 :) 
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2204
Author: "Matt Hunter"
Date: Tue, 03 Nov 2026 01:56
40 lines
9449 bytes
On Mon Nov 2, 2026 at 8:10 PM EST, Ben Knoble wrote:
>> Le 2 nov. 2026 à 19:16, Junio C Hamano <gitster@pobox.com> 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 <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).

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 <A>...<B> 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
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2207
Author: Junio C Hamano
Date: Tue, 03 Nov 2026 02:26
18 lines
13221 bytes
"Matt Hunter" <m@lfurio.us> writes:

> So, I think this <A>...<B> form would yield the expected output if you
> only rewrote history in-place _on the same base commit_, but not in the
> general case?

That is my conclusion and my reason why I do not rebase topic
branches without a good reason.  It is so handy to be able to do

    $ git range-diff @{1}...

after updating the current topic, instead of having to do

    $ git range-diff main..@{1} main..HEAD

where 'main' may have advanced since the previous round forked from
it, or the current round was rebased onto it.
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2317
Author: "Kristoffer Haugsbakk"
Date: Wed, 04 Nov 2026 11:25
49 lines
14464 bytes
On Tue, Nov 3, 2026, at 02:10, Ben Knoble wrote:
>> 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).
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2342
Author: Ben Knoble
Date: Wed, 04 Nov 2026 18:00
54 lines
12758 bytes
> Le 4 nov. 2026 à 06:27, Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> a écrit :
> 
> On Tue, Nov 3, 2026, at 02:10, Ben Knoble wrote:
>>>> 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.
> 
> † 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).

What repetition? 

    git range-diff base old new

;)
Re: [PATCH v3] range-diff: add --matched-only to skip one-sided commits
#2352
Author: "Kristoffer Haugsbakk"
Date: Wed, 04 Nov 2026 18:08
26 lines
13488 bytes
On Wed, Nov 4, 2026, at 19:00, Ben Knoble wrote:
>> Le 4 nov. 2026 à 06:27, Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> a écrit :
>>[snip]
>>
>> 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.
>>
>> † 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).
>
> What repetition?
>
>     git range-diff base old new
>
> ;)

Oh. Right! :D
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads