From: Junio C Hamano <gitster@pobox.com>
To: Aditya Garg <gargaditya08@live.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
Eric Sunshine <sunshine@sunshineco.com>,
"brian m. carlson" <sandals@crustytoothpaste.net>,
Julian Swagemakers <julian@swagemakers.org>,
Zi Yao <ziyao@disroot.org>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] send-email: fix bug breaking shallow threading if the first patch is edited
Date: Fri, 23 May 2025 15:19:04 -0700 [thread overview]
Message-ID: <xmqqwma7ug13.fsf@gitster.g> (raw)
In-Reply-To: <73234CC5-8712-4B7B-94BE-F643345677BD@live.com> (Aditya Garg's message of "Fri, 23 May 2025 15:36:19 +0000")
Aditya Garg <gargaditya08@live.com> writes:
> So, whenever the first patch is sent, $num_sent will become 1.
The reverse is not always true, though.
> # set up for the next message
> + $num_sent++;
> if ($thread) {
> if ($message_was_sent &&
> ($chain_reply_to || !defined $in_reply_to || length($in_reply_to) == 0 ||
> - $message_num == 1)) {
> + $num_sent == 1)) {
This sais "enter this block if we have sent a message and one of
(num_set is 1, or we are told to chain-reply-to, or we do not have
in-reply-to) holds true".
But is $num_set == 1 really limited to "the first message"? Given
that ...
> $in_reply_to = $message_id;
> if (length $references > 0) {
> $references .= "\n $message_id";
> @@ -2060,7 +2061,6 @@ sub process_file {
> $references = '';
> }
> $message_id = undef;
> - $num_sent++;
> if (defined $batch_size && $num_sent == $batch_size) {
> $num_sent = 0;
... the counter is reset when we send out the batch_size message
(and we sleep in this block, which is outside the post-context of
this hunk). So when you send the first message of the next batch,
you'd do the same, no? By that time, we have in_reply_to set, but
that does not prevent from $num_sent, which was reset to 0 at the
batch boundary and then incremented to 1, to reenter the block in
the first hunk, no?
> $smtp->quit if defined $smtp;
next prev parent reply other threads:[~2025-05-23 22:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 15:36 [PATCH] send-email: fix bug breaking shallow threading if the first patch is edited Aditya Garg
2025-05-23 15:44 ` Aditya Garg
2025-05-23 22:19 ` Junio C Hamano [this message]
2025-05-23 23:37 ` Jacob Keller
2025-05-24 12:39 ` [PATCH v2] send-email: fix bug resulting in increased message number if a message " Aditya Garg
2025-05-25 17:12 ` [PATCH v3 0/2] send-email: fix threads breaking in case user edits emails and improvements to outlook ID fix Aditya Garg
2025-05-25 17:12 ` [PATCH v3 1/2] send-email: fix bug resulting in increased message number if a message is edited Aditya Garg
2025-05-25 18:49 ` Kristoffer Haugsbakk
2025-05-26 15:54 ` Aditya Garg
2025-05-25 17:12 ` [PATCH v3 2/2] send-email: show the new message id assigned by outlook in the logs Aditya Garg
-- strict thread matches above, loose matches on Subject: below --
2025-05-24 2:56 [PATCH] send-email: fix bug breaking shallow threading if the first patch is edited Aditya Garg
2025-05-24 2:57 Aditya Garg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwma7ug13.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=gargaditya08@live.com \
--cc=git@vger.kernel.org \
--cc=julian@swagemakers.org \
--cc=peff@peff.net \
--cc=sandals@crustytoothpaste.net \
--cc=sunshine@sunshineco.com \
--cc=ziyao@disroot.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.