{"thread":{"id":"63514","subject":"Re: [PATCH] send-email: fix bug breaking shallow threading if the first patch is edited","startedAt":"2025-05-24T02:57:23Z","lastAt":"2025-05-24T02:57:23Z","messageCount":1,"participants":["Aditya Garg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"518821","messageId":"PN3PR01MB9597B280D9FD284E1B097380B89BA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM","threadId":"63514","inReplyTo":null,"subject":"Re: [PATCH] send-email: fix bug breaking shallow threading if the first patch is edited","fromName":"Aditya Garg","fromEmail":"gargaditya08@live.com","sentAt":"2025-05-24T02:57:17Z","receivedAt":"2025-05-24T02:57:23Z","isPatch":true,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"\n\n> On 24 May 2025, at 5:08 AM, Jacob Keller <jacob.e.keller@intel.com> wrote:\n> \n> ﻿\n> \n>> On 5/23/2025 8:36 AM, Aditya Garg wrote:\n>> There is a bug in send-email that turns off shallow threading if\n>> some special conditions are there. Those conditions are:\n>> \n>> 1. An --in-reply-to must be specified when sending the patch\n>> 2. When asked for confirmation before sending the first patch, the\n>>  user must edit the patch (pressing e and enter).\n>> \n>> If these two conditions are fulfilled, the threading will turn off\n>> and all subsequent messages will become as replies to the\n>> Message-ID set in --in-reply-to, rather than becoming replies to\n>> the first patch.\n>> \n>> The cause of this bug was very simple. There are many conditions\n>> that determine whether threading should be done or not. The\n>> relevant ones for this case are:\n>> \n>> 1. --in-reply-to is not defined\n>> 2. $message_num is 1\n>> \n>> If ANY ONE of these is fulfilled, threading will occur. Now, in\n>> our case, we have defined an --in-reply-to, so condition 1 is\n>> not fulfilled, and thus is omitted out. The only condition that\n>> can enable threading is $message_num being 1. As far as I\n>> understand, this condition was based on the assumption that the\n>> first message being send will have $message_num as 1, since in\n>> case of shallow threads, we just set in-reply-to only for the\n>> Message-ID of the first patch sent. But, in case we edit a patch,\n>> its $message_num increases by one, and thus, our second condition\n>> for threading is also not fulfilled, thus turning off threading.\n>> \n> \n> Why does editing a message change the message_num??? That feels like the\n> real bug to me..\n\nI thought that was intended, not it doesn't seem like that to me.\n"}]}