[go: up one dir, main page]

|
|
Subscribe / Log in / New account

A policy for Link tags

By Jonathan Corbet
September 11, 2025
The Git source-code management system stores a lot of information about changes to code — but it does not hold everything that might be of interest to a developer who needs to investigate a specific change in the future. Commits in a repository are the end result of a (sometimes extended) discussion; often, that discussion will result in changes to the code that are not explained in the changelog. For some years now, many maintainers have followed the convention of applying a Link tag to commits that points back to the mailing-list posting of the change. Linus Torvalds has been expressing his dislike for this convention for a while, though, and its time appears to be coming to an end.

Certain source-code management systems are able to track a change through multiple versions by assigning a "change ID" to the work. Git does not do that, though, so the kernel community does not have an easy way to look at the history of a patch. In a discussion prior to the 2019 Kernel Summit, Shuah Kahn asked whether the community should adopt some sort of change-ID convention to track work heading into the kernel. Doug Anderson proposed something similar a month later. The extended discussions that followed did not lead to the adoption of a change ID, but they did bring about a related change.

Specifically, Thomas Gleixner suggested the use of a Link tag that would contain an archive URL for the posting of each commit on the mailing lists:

What's really useful is when the commit has a Link tag:
   https://lore.kernel.org/lkml/$MESSAGE-ID

and if the submitters provide the same kind of link in their V(N) submission pointing to the V(N-1) in the cover letter:

    https://lore.kernel.org/lkml/$MESSAGE-ID-V(N-1)

If it's a single patch the link can be in the patch itself after the --- separator. That allows a quick lookup of the history.

The Link tag was not new; its first appearance in the kernel repository is in this 2011 commit. That commit, along with 56 others containing Link tags, went into the 2.6.39 release. This tag was mostly used for commits to the x86 and core-kernel subsystems initially, showing up in 3-500 commits per release. As this plot shows, the use of Link tags grew slowly over time, until something happened:

[Plot of link tags per release]

The "something" that happened partway through the 5.2 development cycle was, of course, the above-mentioned discussion. There seemed to be widespread agreement that the addition of Link tags to commits would be helpful. Kees Cook posted a Git hook configuration that would add the tag automatically whenever a patch was applied with git am. Linus Walleij updated the kernel documentation to suggest using this hook; the b4 tool later gained a flag to add Link tags as well. The addition of Link tags grew accordingly; in the 6.16 release, 11,030 commits (75% of the total) included Link tags.

(It is worth noting that the other part of Gleixner's suggestion — including a link to the previous posting whenever a patch series is updated — has not been adopted as widely, though many developers do indeed include those links. These backward links are important, as any LWN kernel writer will attest, if one wishes to look at the history of a change through multiple iterations.)

During the 2019 discussion, Torvalds was lukewarm to the idea of including Link tags; he certainly did not oppose it, and said it was better than trying to create some sort of change ID. By 2022, though, he was beginning to complain about them:

I _really_ wish the -tip tree had more links to the actual problem reports and explanations, rather than links to the patch submission.

One has the actual issue. The other just has the information that is already in the commit, and the "Link:" adds almost no actual value.

This refrain would become more common over the years, culminating in some strongly worded complaints in the middle of discussions on virtual filesystem layer and io_uring patch sets. The core problem remained the same: he does not like it if he follows the URL in a Link tag, hoping to learn more about the change in question, and only finds the same information that is already contained in the changelog itself. That slows his workflow down and increases his grumpiness level.

Various developers have sought to defend the use of these tags in these discussions. Christian Brauner said: "I care that I can git log at mainline and figure out where that patch was discussed, pull down the discussion via b4 or other tooling, without having to search lore". Konstantin Ryabitsev pointed out that it is not always easy to find patch submissions by searching the archives. Jens Axboe said that the tags can help to find the cover letter for a patch series, and that they can also help to turn up discussion that happens after a patch is applied. Greg Kroah-Hartman argued for keeping the tags, saying "they work well for those that have to spelunk into our git branches all the time".

Torvalds, though, has been unmoved by these arguments and steadfastly opposed to the use of Link tags except in cases where there is something "interesting" behind the link. In the recent discussions, Axboe asked repeatedly for a proclamation from Torvalds on what the rules for Link tags should actually be (and suggested summoning LWN for a summary). Torvalds appears to have answered that request in the notes for the 6.17-rc5 release:

So if a link doesn't have any extra relevant information in it, just don't add it at all in some misguided hope that tomorrow it will be useful.

Make "Link:" tags be something to celebrate, not something to curse because they are worthless and waste peoples time.

Please?

Many maintainers are unlikely to celebrate the fact that they have to end the automatic addition of Link tags and think, for each commit, whether such a tag is "interesting" or not. But they can celebrate the fact that the time spent on that exercise will save some time responding to grumpy emails from the Chief Penguin. While the new policy may not be entirely popular among maintainers, there is at least now something approaching an actual policy around the use of these tags.

Index entries for this article
KernelDevelopment model/Patch management


to post comments

Wasting people's time?

Posted Sep 11, 2025 16:00 UTC (Thu) by kleptog (subscriber, #1183) [Link] (1 responses)

After all these people writing to say the Link tag provides them value, Linus says they "waste people's time".

The kernel got a de-facto ChangeId, people start building their workflows around it and now they have to stop because Linus personally doesn't see the value of ChangeIds.

ChangeIds at least have the benefit of not pretending to be anything other than a random string. In that sense they're better than Link tags.

git-am(1) has --message-id

Posted Sep 12, 2025 6:26 UTC (Fri) by alx.manpages (subscriber, #145117) [Link]

$ MANWIDTH=72 man git-am | sed -n '/--message-id/,/^$/p'
       -m, --message-id
           Pass the -m flag to git mailinfo (see git-mailinfo(1)), so
           that the Message-ID header is added to the commit message.
           The am.messageid configuration variable can be used to
           specify the default behaviour.
I've been using this, which keeps the useful information, without adding a link (which might break, and waste people's time).

How about a new field to link to lore?

Posted Sep 11, 2025 16:07 UTC (Thu) by masneyb (subscriber, #7413) [Link] (6 responses)

Personally, I like having the link to lore in the git history, and it's super useful when the series includes links to the previous versions. How about adding a new tag named Submission?

How about a new field to link to lore?

Posted Sep 11, 2025 23:03 UTC (Thu) by sam_c (subscriber, #139836) [Link] (2 responses)

I get Linus' point (I want to know if there's discussion of a bug or some context to read), but indeed, it's pretty handy to have a submission link to reply to if you have a question or something, rather than searching first..

How about a new field to link to lore?

Posted Sep 11, 2025 23:03 UTC (Thu) by sam_c (subscriber, #139836) [Link]

Also, I often find it useful to know if there was some brief review that covered something I was curious about too, even if it wouldn't merit a Linus-level-Link.

How about a new field to link to lore?

Posted Sep 13, 2025 11:33 UTC (Sat) by pbonzini (subscriber, #60935) [Link]

Message IDs are also useful in order to check that a stable submission included the whole series. I often use them when doing backports: starting from a single file or directory's backport, you can use them to track down changes that were required in other parts of the tree.

Or for a less positive example, since the stable maintainers are pretty AI-happy and their tools don't (or didn't until recently) try to backport a whole series, that's the first thing to check if a regression is reported on a stable release.

How about a new field to link to lore?

Posted Sep 12, 2025 9:41 UTC (Fri) by pbonzini (subscriber, #60935) [Link] (2 responses)

Or just use Message-Id (git config set am.messageid true).

How about a new field to link to lore?

Posted Sep 13, 2025 8:35 UTC (Sat) by tiwai (subscriber, #39450) [Link] (1 responses)

The Message-Id tag was one of most hated one, as people prefer the URL where they can just jump in, instead.

I thought (hoped) that using https://patch.msgid.link/... instead of https://lore.kernel.org/... were clear enough to identify that it's a patch submission link, but Linus didn't like this much, either, unfortunately.

How about a new field to link to lore?

Posted Sep 13, 2025 10:54 UTC (Sat) by pbonzini (subscriber, #60935) [Link]

Yeah, but "damned if you do, damned if you don't" is not how you work in a community.

People have been adding lore links because they find them useful. If Linus doesn't like that Link is used that way, those same people will need another way to embed the same information, and the best way to do so is the one that git has provided for about 10 years (in fact I contributed it ;)).

Multiplexed fields

Posted Sep 11, 2025 16:30 UTC (Thu) by tux3 (subscriber, #101245) [Link]

The confusion I'm under is why one would see this multiplexing and resolve it towards the less common manual usage, instead of the established automated usage.
If there is such a thing as links to extra relevant information that the maintainer is likely to want to read, couldn't they rather be in the patch itself, where most of the other information intended for human consumption is?

I can see how it would be disappointing to follow links that are almost always automated, expecting them not to be. I think my brain is wired in such a way that I would learn not to do that, and judge a patch only on its human content. If it has to be rejected because a meaningful link was cleverly hidden inside metadata, perhaps the submitter would also learn to make it more prominent next submission.

Two tags needed

Posted Sep 11, 2025 17:30 UTC (Thu) by epa (subscriber, #39769) [Link]

So we need Link: and Linus-Link: tags. The latter only when you're sure it is something Linus would like to read.

git hidden by default notes

Posted Sep 11, 2025 21:52 UTC (Thu) by quotemstr (subscriber, #45331) [Link] (11 responses)

It'a a shame git commit notes haven't taken off as well as one might like. If the problem is the visual noise that a link tag introduces, the solution IMHO isn't to omit the information, but rather to just hide it by default. I'm not sure Linus's objection is rooted in anything other than visual aesthetics.

git hidden by default notes

Posted Sep 12, 2025 3:17 UTC (Fri) by wtarreau (subscriber, #51152) [Link] (9 responses)

I agree that git notes could have worked better.

Regarding the link tag, the problem here is that it has two different use cases: one that links to a patch submission possibly with no discussion, and another which is to point to a discussion. When it's automated, you never know if you'll find a discussion there and often it's not. So in fact there should be a different tag (if at all) to explicitly designate a discussion. What's annoying with generic tags is that there's no wording around to indicate what to hope from there. When it's written "Based on the discussion at https://..." it's clear what to expect. But "link:" (especially automated) can be anything.

Also I generally dislike having to copy-paste links to get more information. While it's claimed that lore will exist forever, it will change every 20 years like anything else. I'm seeing some projects on github with no commit message except "addresses issue #1234". The day the project moves or the account is blocked, they lose all history! I find it very important to indicate in the commit message what was attempted to be done, why and why other options were not kept. The links should only be for the details of the discussion.

git hidden by default notes

Posted Sep 12, 2025 3:33 UTC (Fri) by ebiederm (subscriber, #35028) [Link] (8 responses)

You mention the possibility of lore not lasting.

For the link tags it doesn't really matter. They embed the emails unique identifier. An identifier scheme that dates back to nntp. So as long as someone has an appropriately indexed set of emails it will be possible to find the email the link tag refers to.

git hidden by default notes

Posted Sep 12, 2025 12:38 UTC (Fri) by daroc (editor, #160859) [Link] (7 responses)

For example, one can turn a lore link into a link to our email archives like this:

https://lore.kernel.org/bpf/CACYkzJ6VQUExfyt0=-FmXz46GHJh...

->

s,lore.kernel.org,lwn.net/ml,
s,/#t,,

->

https://lwn.net/ml/bpf/CACYkzJ6VQUExfyt0=-FmXz46GHJh3d=FX...

git hidden by default notes

Posted Sep 13, 2025 7:57 UTC (Sat) by wtarreau (subscriber, #51152) [Link] (5 responses)

Yeah I agree that in this specific case the risk of total loss is limited, even if both lore and lwn would disappear; some of us still have the whole lkml archives going back many years (mine start at 2002). But that shouldn't justify abusing Link for not explaining what a commit does. IMHO it should be limited to "for those who want to know more or still disagree with the choice in this patch, please refer to that long discussion". And particularly when you're dealing with backports, you absolutely need to have helpful explanation in the commit message, otherwise it takes ages to validate each patch one at a time!

git hidden by default notes

Posted Sep 14, 2025 4:13 UTC (Sun) by ebiederm (subscriber, #35028) [Link] (4 responses)

It is even a smidge better as anyone can git clone lore's current archives, and run public-inbox to serve themselves a local copy.

I do agree none of that justifies not putting all of the relevant information in commit mesages.

That said I would really like to see the link tag to the submission email, in addition to links to v1, v2, v3,v4 etc.

I have done way too much code archeolgy in the pre git archives and it is near impossible to find the patch submissions, let alone the conversation that led to the code. So several times despite finding the committs I have been reduced to guessing, to know why a change was made.

Most recently I fixed a regression that came in linux-2.4.0-test12, to setuid executables. Someone had refactored the code at the last minute, moved the code from fs/exec to security/commoncap and introduced a function is_setuid that was bizarre. It tested the uid and suid in the new cred to see if they matched, completely ignoring the old cred, and the possibility of an code with a misnatched uid and suid calling exec on a suid executable. At the end of the day idea if testing for setuid execution was wrong at that spot. My fix was to restore the behavior prior to linux-2.4.0-test12. This regression was found because it worked fine on other unices. That fix didn't get merged until sometime this year.

For things like that the submission emails would at least allow knowing if a change is part of a series, and give hints on where to look for the rest of the discussion. Something to go on.

With the slowly growing complexity of the core kernel my sense is that small slip ups like that are on rise as a percentage of patches in the kernel. Which is very unfortunate because I ran out of time before I could finish fixing everything I know about that came in prior to 2.6.0 being released, and I have seen some merged in more recent kernels.

So for the people who have to fix the corners cases no one thought would matter, but that turn out they do matter. Let's please include as much information as we easily and accurately can in the commit record. Let's give the poor souls who have to fix the bugs a chance.

git hidden by default notes

Posted Sep 14, 2025 14:35 UTC (Sun) by stevie-oh (subscriber, #130795) [Link] (1 responses)

Am I understanding you correctly? You fixed a setuid bug that's been present for a quarter century?

git hidden by default notes

Posted Sep 14, 2025 19:14 UTC (Sun) by ebiederm (subscriber, #35028) [Link]

Pretty much.

Take a look at the git history if you want the details.

It failed safe, as in fewer permissions than then caller should have. And it is dealing with cases that practically never happen. So I don't think there was anything exploitable about it.

But it was doing the wrong thing for the wrong reason.

git hidden by default notes

Posted Sep 15, 2025 3:54 UTC (Mon) by wtarreau (subscriber, #51152) [Link] (1 responses)

I'm not contesting that, and you're even discussing a pre-git commit. We all know that it's difficult to find the relevant e-mails for these. That's actually my point: e-mails may ultimately disappear or be hard to find (even having to copy-paste a message ID to enter it into a different location is a pain), while by design the git history is part of what we clone. That's why I'm advocating for having very detailed commit messages, which particularly detail the intent (too often missing). I generally say that we have to "sell" our patches, i.e. explain in the patch why one absolutely needs it and cannot live without. And I can assure you that when I was dealing with extended LTS, this type of information was super rare.

IMHO the part related to the patch submission is usually useless (just results in ack-by, reviewed-by and that's all). There's rarely even any info beyond what's already present in the commit messages themselves. However, *discussions* are useful, and I agree they can continue past a submission. But if a discussion just starts after a submission, usually it'll lead to a new series, and if it happens past a merge, it will lead to a fix, which can be linked to.

I used to visit links when they were about discussion, nowadays I don't anymore because I rarely hope to find anything but a list of ack-by/reviewed-by. That's why I think that a single tag for two purposes is what introduces the noise in the first place and degrades the value of the link tag; Indeed a submitted-at tag could help by keeping link dedicated to real discussion(s) or even papers (e.g. when implementing an algorithm or fixing a vulnerability described in a public report).

git hidden by default notes

Posted Sep 22, 2025 2:56 UTC (Mon) by SLi (subscriber, #53131) [Link]

Sure, commit messages should be detailed, but I'd argue that there's still something that discussions add to them that shouldn't end up in the commit message.

If anything, when later investigating changes, it's useful to see what was considered, what other approaches someone would have wanted taken and why, etc.

A commit message should still sell the patch, not explain an entire complicated discussion about a topic together with objections.

git hidden by default notes

Posted Sep 15, 2025 16:37 UTC (Mon) by paulj (subscriber, #341) [Link]

So really, for these purposes, it should be a "Message-ID" tag or somesuch - and just specify the message ID alone - rather than a more general "Link" tag.

git hidden by default notes

Posted Sep 12, 2025 13:02 UTC (Fri) by vegard (subscriber, #52330) [Link]

Try this: https://git.kernel.org/pub/scm/linux/kernel/git/vegard/li...

Here is an example where a lore link was added after the fact through patch ID or subject matching: https://git.kernel.org/vegard/c/dcb23e1878013

Can we encourage people to make lore links on git commits more useful?

Posted Sep 12, 2025 3:35 UTC (Fri) by sjpark (subscriber, #87716) [Link]

From the 6.16-rc5 release note, below made me better understand why Linus argues the lore link is not useful.

> When bugs happen, people don't go to the original emailed patch
> to talk about them.

So I can understand Linus' frustration, but ...

I personally do report on the original emailed patch, and the lore link on git commit is very helpful. As a result I can get whole related discussions (or links to related discussions) from the original thread, without searching more. I'm wondering if we can encourage people to report bugs or whatever on the original emailed patch, or at least add relevant after-posting discussions on the original patch mail thread, to make the lore links on git commits more useful enough to convince Linus sometime in future.

Link in merge commits

Posted Sep 12, 2025 8:59 UTC (Fri) by mzyngier (subscriber, #32898) [Link]

My commit flow involves creating a topic branch for any patch series I pick from the list, and merge this branch on the main branch for the subsystem I maintain (KVM/arm64).

The merge commit contains a description of the series, and I plan to add a link back to the ML as part of this commit message. At least, it indicates where the series has been lifted from, and still allows people to easily find the thread and respond to it (to report a bug, for example...).

I hope this is an acceptable middle ground between spraying Link: tags on all commits and the total absence of provenance information.

All or nothing

Posted Sep 14, 2025 18:46 UTC (Sun) by nevets (subscriber, #11875) [Link] (1 responses)

My scripts automatically add the link tags when I pull them into git. When people send me new versions of a patch, I always suggest to put a link to the previous version under the three hashes. This way, even if the patch added doesn't have a discussion, it at least has a link back to the previous versions of the patch that may have the discussion. I'm not gonna waste time figuring out if a link is required or not. If I have to remove link tags to satisfy Linus's rule, I'll remove the addition from scripts and have no link tags regardless if there was a discussion or not.

The other useful case of link tags with no discussion is when I run my tests and the test fails on somebody else's commit. I do a bisect, and hope the commit has a link tag to the patch. If it does, I go to lore, download the mbox from it, and reply to that patch with the bug report. Guess what? That useless link is no longer useless. It now has a discussion to why that commit broke

All or nothing

Posted Sep 14, 2025 20:16 UTC (Sun) by pbonzini (subscriber, #60935) [Link]

> If I have to remove link tags to satisfy Linus's rule, I'll remove the addition from scripts and have no link tags regardless if there was a discussion or not.

Please don't, it's information that is very useful and people were adding it because it is. Whether it's a link or message-id trailer I don't care, but it should be there *somewhere*. Linus doesn't do backports...

No alternative, really?

Posted Sep 15, 2025 22:11 UTC (Mon) by marcH (subscriber, #57642) [Link] (1 responses)

So, the most basic connectivity feature (provided by design by every single forge...) was not perfect but it was very useful and actively used by many people - even when there was no discussion in the last submission.

But it wasn't suited to the boss, so it just goes away without any replacement? No Change-ID, no new tag, none of the various alternatives that have been offered? Did I miss anything?

If that did not break some "userspace" then I don't know what does.

This also feeds perfectly the narrative that the kernel review process is authoritative, arbitrary and broken.

Linux and git were heavily based on "prior art": 1. Look at everything that already exists; 2. Outclass it. But as far as "forges" as concerned, the kernel "power(s)" seems to assume that all prior art is automatically bad; despite forges being used by pretty much the entire rest of the world... The current algorithm seems to be "IF has(web interface) OR has(database) THEN bad! Ignore it _all_". This is genuinely sad.

PS: thanks for the stellar summary. At least something good in that space; too bad it's only the reporting.

Link: vN-1 ?

Posted Sep 15, 2025 22:18 UTC (Mon) by marcH (subscriber, #57642) [Link]

> ... even when there was no discussion in the last submission.

So let's take for example cases where the most "interesting" discussion (for some subjective definition of "interesting) happened in the vN-1 or vN-2 submission. That sounds pretty common. Should/can submitters manually add some "Link: v(N-1)" then?

Have answers to questions like this one been submitted as patches to https://docs.kernel.org/process/submitting-patches.html yet? That sounds like a minimum before changing the existing practice.

I'm replying to myself in a different LWN comment because this is a different topic. This question here is about "interesting" links as opposed to "not interesting" links (where the only "interest" that matters is the boss')


Copyright © 2025, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds