{"thread":{"id":"63513","subject":"Re: [PATCH] send-email: fix bug breaking shallow threading if the first patch is edited","startedAt":"2025-05-24T02:56:47Z","lastAt":"2025-05-24T02:56:47Z","messageCount":1,"participants":["Aditya Garg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"518820","messageId":"PN3PR01MB959739D5935F0BACD724FAA1B89BA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM","threadId":"63513","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:56:42Z","receivedAt":"2025-05-24T02:56:47Z","isPatch":true,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"\n\n> On 24 May 2025, at 3:49 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> \n> ﻿Aditya Garg <gargaditya08@live.com> writes:\n> \n>> So, whenever the first patch is sent, $num_sent will become 1.\n> \n> The reverse is not always true, though.\n> \n>>    # set up for the next message\n>> +    $num_sent++;\n>>    if ($thread) {\n>>        if ($message_was_sent &&\n>>          ($chain_reply_to || !defined $in_reply_to || length($in_reply_to) == 0 ||\n>> -          $message_num == 1)) {\n>> +          $num_sent == 1)) {\n> \n> This sais \"enter this block if we have sent a message and one of\n> (num_set is 1, or we are told to chain-reply-to, or we do not have\n> in-reply-to) holds true\".\n> \n> But is $num_set == 1 really limited to \"the first message\"?  Given\n> that ...\n> \n>>            $in_reply_to = $message_id;\n>>            if (length $references > 0) {\n>>                $references .= \"\\n $message_id\";\n>> @@ -2060,7 +2061,6 @@ sub process_file {\n>>        $references = '';\n>>    }\n>>    $message_id = undef;\n>> -    $num_sent++;\n>>    if (defined $batch_size && $num_sent == $batch_size) {\n>>        $num_sent = 0;\n> \n> ... the counter is reset when we send out the batch_size message\n> (and we sleep in this block, which is outside the post-context of\n> this hunk).  So when you send the first message of the next batch,\n> you'd do the same, no?  By that time, we have in_reply_to set, but\n> that does not prevent from $num_sent, which was reset to 0 at the\n> batch boundary and then incremented to 1, to reenter the block in\n> the first hunk, no?\n> \n\nHmm, you are right, that's a problem. I think we need to fix message\nnumber then.\n"}]}