Hi all, This patch series fixes two minor issues with git-send-email. The first patch fixes a bug that caused the message number to increase when a user edits an email. As a result of this bug, threads would break when a user edits an email. The second patch improves the logging of the new message ID assigned by Outlook when a user edits an email. v2 - Change the bugfix logic used to fix the threading bug. v3 - Add additional patch to improve the logging of the new message ID assigned by Outlook. v4 - Completely rewrite the commit message of the first patch to explain the bug in detail and how it is fixed. Also, add example logs to explain the second patch. v5 - Fix numerous spelling and grammatical errors in the commit message of the first patch. v6 - Change the subject of the first patch. - Prefer using "increment" instead of "increase" in the commit message of the first patch. - Avoid decreasing the `$message_id_serial` variable in the first patch. v7 - Remove unecessary comment in the second patch. - Mild rewording of the commit message of the second patch. - Fix incrmented -> incremented Aditya Garg (2): send-email: fix bug resulting in broken threads if a message is edited send-email: show the new message id assigned by outlook in the logs git-send-email.perl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) Range-diff against v6: 1: a5dcec5428 ! 1: 05724ae6d3 send-email: fix bug resulting in broken threads if a message is edited @@ Commit message one, which is intended. But, if a message is edited and then resent, its message number again - gets incrmented. This is because the script uses the same logic to + gets incremented. This is because the script uses the same logic to process the edited message, which it uses to send the next message. This minor bug is usually harmless, unless a special situations arises. 2: 43227e8a5e ! 2: 360391c8e2 send-email: show the new message id assigned by outlook in the logs @@ Commit message Result: 250 - This patch fixes this by modifying the $header variable, which is - responsible for showing the logs at the end. Also, the log which states - that the Message-ID has been changed will now be shown only when - smtp-debug is enabled, since the main log having all of the headers is - anyways displaying the new Message-ID. It should look like this after - this patch: + Fix this by updating the $header variable, which has the message ID we + internally assigned on the "Message-ID:" header, with the message ID the + Outlook server assigned. It should look like this after this patch: OK. Log says: Server: smtp.office365.com @@ git-send-email.perl: sub send_message { if ($smtp->message =~ /<([^>]+)>/) { $message_id = "<$1>"; - printf __("Outlook reassigned Message-ID to: %s\n"), $message_id; -+ # Replace the original Message-ID in $header with the new one + $header =~ s/^(Message-ID:\s*).*\n/${1}$message_id\n/m; + printf __("Outlook reassigned Message-ID to: %s\n"), $message_id if $smtp->debug; } else { -- 2.49.0.windows.1