tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* In defense of Link (was Re: [b4] initial "b4 dig" to supplant Link: trailers)
@ 2025-10-11  5:59 Paolo Bonzini
  2025-10-11  6:13 ` Willy Tarreau
  2025-10-13 12:21 ` Michael S. Tsirkin
  0 siblings, 2 replies; 81+ messages in thread
From: Paolo Bonzini @ 2025-10-11  5:59 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: users, tools

Il ven 10 ott 2025, 22:55 Konstantin Ryabitsev
<konstantin@linuxfoundation.org> ha scritto:
>
> Hi, all:
>
> I just committed the initial implementation of "b4 dig" that will hopefully
> make it easier for maintainers to figure out where a commit came from now that
> we're actively trying to phase out Link: trailers


Please let's not. I refrained from making statements during the merge
window and hijacking my pull requests, but I have something to say
about this topic and a soapbox to stand on. I'm keeping "users" as the
recipient for lack of a better place, but if people are interested in
the topic and prefer to have it in a more public place please let me
know.

tl;dr: Trailers are metadata, not data, and the link to the posting on
the mailing list is useful metadata. It was added to "git am" (by
yours truly) for a reason[1]. In fact it's fundamental for the work
that many people do on the kernel.

Let's look at various personas, how they use links and how/if they
could be replaced.

1) the intermediate maintainer. That's me. I get PRs from sub
maintainers and send them to Linus. When I receive a pull request I
review them and look especially for userspace API issues. If I find a
problem I will ask for a respin, and I will also reply in the original
thread because I am effectively doing a belated review and there will
be a v(n+1) of the patches. While something like "b4 dig" might work,
it's an approximation of perfectly good data that was available to
whoever applied the patch.

2) the stable tree contributor. After being asked to bisect for which
commit fixed an issue, a young and enterprising reporter finds that
the fix cherry picks nicely. As a subsystem maintainer you're happy
that the user saved some work for you, only to spot -7- in the message
id. Oops, better check the boundaries of the series. Giving a merge
commit to each series would also help here, but Message-Id is almost
always correct and so easily available that it almost becomes second
nature. When it's not there, you *know* that you have to check in a
different way; the solution is to add more Message-Id links not to
remove them.

3) the stable tree maintainer. Ideally, the same process I have just
mentioned for a person would be applied by whatever magic logic the
stable tree maintainers used. I know for a fact that as of a few
months ago they didn't, and this has wasted time for both stable tree
maintainers and subsystem maintainers (me) when they cherry picked
patches 50-55 of a series and it unsurprisingly didn't work. Given the
various reasons why one could use a merge commit, they are not easily
consumed by scripts and not as good a replacement as the known format
used by git-send-email. Which, again, is just *there*.

4) anyone investigating commit relationships and dependencies. It
could be anyone researching "git log" to fix a bug, or a downstream
patch juggler[2]. Again, links help understanding the boundaries of
the series. A decent replacement here is  "git describe --contains",
but message ids have the advantages of just being there in the git
log, if they are trailers. I will usually start with message IDs and
later do a second pass finding the "git describe --contains" of all
the commits I am cherry picking.


On top of this, adding a random Link as a trailer does not tell you
*why* the link was added. It's much clearer to "connect" a sentence in
the commit message to the link using e.g. [1] or [2], than to have a
"Link" trailer amid unrelated metadata.

Linus complained about Message-Id too in the past, but if Linus does
not like Link or Message-Id then fine, but can we please take into
account that he is quite obviously unique among kernel developers? ;)

If there has to be another solution then fine, but the solution is not
throwing compute power at the problem, it's *not losing data in the
first place*. Let's figure out what the solution is, document it, and
have all maintainers switch to it. And until then, keep the existing
convention in place.

Thanks,

Paolo

[1] "git am" adding Message-Id predates Link as far as I know. It's
less handy than a clickable link, but again the known format used by
git send-email comes to help. I have configured my terminal so that
"email addresses" starting with "20" open in lore rather than as
mailto URLs. :))

[2] say what you want about companies not using stable trees, but they
exist and several are among the top 5-10 contributors to Linux. A
simple process to move commits between upstream and downstream
benefits everyone, and anyway as I said earlier it's not like stable
kernels don't benefit.

> For now, it only does
> "b4 dig -c [commitish]", e.g. taking some random commits from today:
>
> Matching the exact patch-id:
>
>         $ b4 dig -c ce740955b238761ec1d8cf0590d7e6802d3a813a
>         Digging into commit ce740955b238761ec1d8cf0590d7e6802d3a813a
>         Attempting to match by exact patch-id...
>         Trying to find matching series by patch-id 469ebf2cf560b32106f206e389752deb5f741b6d
>         Grabbing search results from lore.kernel.org
>         Found matching series by patch-id
>         ---
>         This patch is present in the following series:
>         ---
>           v3: [PATCH v3] dt-bindings: bus: renesas-bsc: allow additional properties
>                   https://lore.kernel.org/r/20251009183630.5451-2-wsa+renesas@sang-engineering.com
>
> No match looking up by exact patch-id (and trying myers, then histogram, then
> patience algorithms with no success):
>
>         $ b4 dig -c a29ad21b988652dc60aa99c6d3b1e3d52dc69c30
>         Digging into commit a29ad21b988652dc60aa99c6d3b1e3d52dc69c30
>         Attempting to match by exact patch-id...
>         Trying to find matching series by patch-id abc964d5d53674450f7e553bbe031edc61ac3308
>         Grabbing search results from lore.kernel.org
>         Nothing matching that query.
>         Trying to find matching series by patch-id adf0918395a1a601a8d54d7d26446aadfb6101c2
>         Grabbing search results from lore.kernel.org
>         Nothing matching that query.
>         Attempting to match by author and subject...
>         Grabbing search results from lore.kernel.org
>         Found 22 matching messages
>         ---
>         This patch is present in the following series:
>         ---
>           v3: [PATCH v3] tpm: Prevent local DOS via tpm/tpm0/ppi/*operations
>                   https://lore.kernel.org/r/20250829175152.9704-2-daleksan@redhat.com
>           v4: [PATCH v4] tpm: Prevent local DOS via tpm/tpm0/ppi/*operations
>                   https://lore.kernel.org/r/20250902142429.14041-2-daleksan@redhat.com
>           v5: [PATCH v5] tpm: Prevent local DOS via tpm/tpm0/ppi/*operations
>                   https://lore.kernel.org/r/20250915210829.6661-1-daleksan@redhat.com
>
> There are known annoyances:
>
> 1. We don't currently weed out AUTOSEL/stable backports, so older commits may
>    end up in lots of false positives for now. I've not yet figured out how to
>    avoid this without hardcoding it to be kernel-specific.
> 2. Patches that were sent as part of one series and then as part of another
>    series (by the same author) don't currently do the right thing.
>
> I'll work on getting that fixed, but for now if you're missing the presence of
> Link: trailers, please test it out.
>
> -K
>


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

end of thread, other threads:[~2025-10-16 16:48 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-11  5:59 In defense of Link (was Re: [b4] initial "b4 dig" to supplant Link: trailers) Paolo Bonzini
2025-10-11  6:13 ` Willy Tarreau
2025-10-11  6:33   ` Paolo Bonzini
2025-10-15  8:56     ` Geert Uytterhoeven
2025-10-11  6:39   ` Jiri Slaby
2025-10-11 10:33   ` Mark Brown
2025-10-12 23:27     ` Jason Gunthorpe
2025-10-13  8:18       ` Vlastimil Babka (SUSE)
2025-10-13  8:27         ` Paolo Bonzini
2025-10-13  8:42           ` Willy Tarreau
2025-10-13  8:48             ` Jiri Slaby
2025-10-13  8:56               ` Willy Tarreau
2025-10-13 11:21                 ` Laurent Pinchart
2025-10-13 14:26                   ` [workflows]Re: " Steven Rostedt
2025-10-13 14:39                     ` Laurent Pinchart
2025-10-13 14:59                       ` Steven Rostedt
2025-10-13 15:04                         ` Laurent Pinchart
2025-10-13 15:44                           ` Steven Rostedt
2025-10-13 11:03           ` Mark Brown
2025-10-13 11:49             ` James Bottomley
2025-10-13 12:15               ` Mark Brown
2025-10-13 12:29               ` Paolo Bonzini
2025-10-13 12:47                 ` James Bottomley
2025-10-13 13:02                   ` Jürgen Groß
2025-10-15 18:05                   ` Jeff Johnson
2025-10-16 16:47     ` Linus Torvalds
2025-10-13 12:21 ` Michael S. Tsirkin
2025-10-13 17:00   ` Linus Torvalds
2025-10-13 18:14     ` Paolo Bonzini
2025-10-13 18:53       ` Linus Torvalds
2025-10-13 20:12         ` Junio C Hamano
2025-10-13 21:44           ` Linus Torvalds
2025-10-13 23:22             ` Sasha Levin
2025-10-14  1:29               ` Linus Torvalds
2025-10-14  3:39             ` Willy Tarreau
2025-10-16 14:52               ` Geert Uytterhoeven
2025-10-16 15:08                 ` Jason Gunthorpe
2025-10-16 15:33                   ` Geert Uytterhoeven
2025-10-13 22:31         ` Paolo Bonzini
2025-10-14  6:47           ` Jiri Slaby
2025-10-13 21:59     ` Theodore Ts'o
2025-10-13 23:09     ` Michael S. Tsirkin
2025-10-14  1:23       ` Linus Torvalds
2025-10-14 10:38         ` Michael S. Tsirkin
2025-10-14 16:56           ` Linus Torvalds
2025-10-14 18:05             ` Luck, Tony
2025-10-14 18:41               ` Linus Torvalds
2025-10-14 19:09                 ` Paolo Bonzini
2025-10-14 21:10                 ` Jason Gunthorpe
2025-10-15  7:37                 ` Geert Uytterhoeven
2025-10-15  7:33     ` Geert Uytterhoeven
2025-10-15  9:38       ` Miguel Ojeda
2025-10-15 12:11         ` Mark Brown
2025-10-15 13:50           ` James Bottomley
2025-10-15 13:59             ` Jürgen Groß
2025-10-15 15:08             ` Mark Brown
2025-10-15 15:14             ` Peter Zijlstra
2025-10-15 15:18               ` [workflows]Re: " Steven Rostedt
2025-10-15 15:53                 ` Peter Zijlstra
2025-10-15 15:59                   ` Steven Rostedt
2025-10-15 16:06                     ` Peter Zijlstra
2025-10-15 16:15                       ` Steven Rostedt
2025-10-15 16:43                         ` Mark Brown
2025-10-15 16:15                       ` Vlastimil Babka (SUSE)
2025-10-15 16:44                         ` Steven Rostedt
2025-10-15 16:58                           ` Konstantin Ryabitsev
2025-10-16  9:28                             ` Matthieu Baerts
2025-10-15 17:01                           ` Miguel Ojeda
2025-10-15 18:40                       ` Laurent Pinchart
2025-10-16  7:32                         ` Peter Zijlstra
2025-10-16  8:20                           ` Vlastimil Babka (SUSE)
2025-10-16 13:58                             ` Steven Rostedt
2025-10-15 14:37           ` Miguel Ojeda
2025-10-15 14:50         ` [workflows]Re: " Steven Rostedt
2025-10-15 13:51       ` Martin K. Petersen
2025-10-15 14:16         ` Konstantin Ryabitsev
2025-10-15 14:42           ` Miguel Ojeda
2025-10-15 15:03             ` Jason Gunthorpe
2025-10-15 14:55           ` [workflows]Re: " Steven Rostedt
2025-10-15 17:34           ` Martin K. Petersen
2025-10-15 14:51         ` Geert Uytterhoeven

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