tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* b4 patch selection logic
@ 2024-05-22 16:10 Linus Torvalds
  2024-05-22 16:27 ` Konstantin Ryabitsev
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Linus Torvalds @ 2024-05-22 16:10 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

So I've hit this before, but I hit it again today, and I wonder what
the right solution is.

I have *one* solution, so it's fine, but it feels wrong.

Anyway, the best way to explain is with the actual workflow issue,
where doing a simple

    b4 am 20240515091727.22034-1-laoar.shao@gmail.com

to pick up the patch in that email results in b4 picking up a
completely *different* and older patch, just because it follows the
threading and finds something else entirely.

The solution is trivial: use "--no-parent", and b4 simply won't walk
up the thread. But it really feels like b4 is doing something wrong
for that to be needed.

The thread is obviously this:

    https://lore.kernel.org/all/20240515091727.22034-1-laoar.shao@gmail.com/

and you can see what happens in the thread overview: it walks up to
the root of the discussion, and then notices that there's a "v2" of
the original patch.

But the message ID that I actually pointed at is a *different* patch
with a different subject line, and is newer than either the original
or the v2 in that thread. So I feel like the patch selection logic is
a bit broken here. It's in the same discussion thread, yes, but b4
shouldn't walk around and pick an *older* patch with a different
subject line just because of that.

Anyway, not a big deal. I've hit this multiple times before, this time
I randomly just decided to mention it.

                  Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: b4 patch selection logic
  2024-05-22 16:10 b4 patch selection logic Linus Torvalds
@ 2024-05-22 16:27 ` Konstantin Ryabitsev
  2024-05-22 16:40   ` Linus Torvalds
  2024-05-22 16:30 ` Kernel.org Bugbot
  2024-05-30 19:50 ` Kernel.org Bugbot
  2 siblings, 1 reply; 5+ messages in thread
From: Konstantin Ryabitsev @ 2024-05-22 16:27 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: tools

On Wed, May 22, 2024 at 09:10:50AM GMT, Linus Torvalds wrote:
> But the message ID that I actually pointed at is a *different* patch
> with a different subject line, and is newer than either the original
> or the v2 in that thread. So I feel like the patch selection logic is
> a bit broken here. It's in the same discussion thread, yes, but b4
> shouldn't walk around and pick an *older* patch with a different
> subject line just because of that.

I agree that this can be more intuitive -- let me see if I can improve it to
automatically apply --no-parent logic when we recognize that a patch posted in
the middle of a longer thread is not within the same series.

Thank you for providing the use-case.

bugbot assign to me

-K

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: b4 patch selection logic
  2024-05-22 16:10 b4 patch selection logic Linus Torvalds
  2024-05-22 16:27 ` Konstantin Ryabitsev
@ 2024-05-22 16:30 ` Kernel.org Bugbot
  2024-05-30 19:50 ` Kernel.org Bugbot
  2 siblings, 0 replies; 5+ messages in thread
From: Kernel.org Bugbot @ 2024-05-22 16:30 UTC (permalink / raw)
  To: tools, tools, torvalds, konstantin

Hello:

This conversation is now tracked by Kernel.org Bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=218874

There is no need to do anything else, just keep talking.
-- 
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (peebz 0.1)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: b4 patch selection logic
  2024-05-22 16:27 ` Konstantin Ryabitsev
@ 2024-05-22 16:40   ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2024-05-22 16:40 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

On Wed, 22 May 2024 at 09:27, Konstantin Ryabitsev
<konstantin@linuxfoundation.org> wrote:
>
> I agree that this can be more intuitive -- let me see if I can improve it to
> automatically apply --no-parent logic when we recognize that a patch posted in
> the middle of a longer thread is not within the same series.

My gut feel is that if the message ID directly points to a patch, that
patch should always be in the result unless there is a newer patch
"below" it in the discussion..

IOW, I _think_ the logic should be that the "walk up to the parent"
should only be about finding clever letters and finding other patches
in the same series.

But I really haven't thought it through a lot, and maybe it breaks
other real-life cases where somebody has posted multiple versions of
the same patch in the same discussion.

One solution might also simply be that when b4 finds another patch
than the one it was pointed at, it always just documents that very
clearly in the output, and says something along the lines of

 "I picked another patch, if you want the particular version you
pointed at, use XYZ"

At least in theory, using '--no-parent' might not always be sufficient
- maybe somebody decides that a newer 'v2' in the same series is
actually a mistake.

That said, the times I've hit this issue, the answer has always been
"--no-parent", so that "I want v1 despite there being a v2" may be a
purely theoretical thing that never happens.

           Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: b4 patch selection logic
  2024-05-22 16:10 b4 patch selection logic Linus Torvalds
  2024-05-22 16:27 ` Konstantin Ryabitsev
  2024-05-22 16:30 ` Kernel.org Bugbot
@ 2024-05-30 19:50 ` Kernel.org Bugbot
  2 siblings, 0 replies; 5+ messages in thread
From: Kernel.org Bugbot @ 2024-05-30 19:50 UTC (permalink / raw)
  To: torvalds, konstantin, tools, tools

Konstantin Ryabitsev writes in commit bf739cd377c7f7c46e01d4058fc3b9993eb44e74:

Auto-noparent standalone patches in the middle of a thread

Automatically recognize situations when a patch or a series is posted in
the middle of a larger thread and automatically apply --no-parent.

Currently works in the following situations:

- a single patch without any versioning info (i.e. just [PATCH])
- a series without versioning info, in which case we will attempt
  to find the cover letter or the first patch in the series

Lightly tested on the use-case specified in the bugzilla entry.
All other cases still need --no-parent.

Link: https://msgid.link/CAHk-%3Dwjt8e26xgW190%3DWs2hrgDsDN6BhCie2do6uQqrcAzF6JA@mail.gmail.com
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218874
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>

(via https://git.kernel.org/pub/scm/utils/b4/b4.git/commit/?id=bf739cd377c7)
-- 
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (peebz 0.1)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-30 19:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22 16:10 b4 patch selection logic Linus Torvalds
2024-05-22 16:27 ` Konstantin Ryabitsev
2024-05-22 16:40   ` Linus Torvalds
2024-05-22 16:30 ` Kernel.org Bugbot
2024-05-30 19:50 ` Kernel.org Bugbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).