Jeff King [off-list ref] writes:
Ah. The problem is that git-send-email unconditionally adds a
message-id. Usually git-format-patch doesn't add one, but for obvious
reasons, it must when doing --thread. Here is a fix.
quoted hunk
diff --git a/git-send-email.perl b/git-send-email.perl
index 1d6f466..083466a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -580,7 +580,7 @@ sub send_message
$ccline = "\nCc: $cc";
}
my $sanitized_sender = sanitize_address($sender);
- make_message_id();
+ make_message_id() unless defined($message_id);
Isn't this called inside a loop? If the outgoing message does not
originally have "Message-Id:", does the loop correctly reinitialize
$message_id to undef, or does this change make everybody reuse the same
$message_id over and over again?
I have a feeling that --thread to format-patch is a misfeature. Why is
it needed if you are feeding the output to send-email?
I wonder if stripping existing "Message-Id:" away just like we strip
away "Date:" from @xh would be a much saner fix.
On Mon, Dec 17, 2007 at 01:27:20PM -0800, Junio C Hamano wrote:
quoted
my $sanitized_sender = sanitize_address($sender);
- make_message_id();
+ make_message_id() unless defined($message_id);
Isn't this called inside a loop? If the outgoing message does not
originally have "Message-Id:", does the loop correctly reinitialize
$message_id to undef, or does this change make everybody reuse the same
$message_id over and over again?
Yes, sorry. I realized it right after I sent the other out, but then a
repairman showed up to fix my non-working furnace. :)
The following needs to be squashed in (alternatively, the message_id
doesn't need to be a loop variable, so it could be cleaned up. But part
of me says that git-send-email is beyond hope for being clean).
diff --git a/git-send-email.perl b/git-send-email.perl
index 083466a..248d035 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -808,6 +808,7 @@ foreach my $t (@files) {
$references = "$message_id";
}
}
+ $message_id = undef;
}
if ($compose) {
I have a feeling that --thread to format-patch is a misfeature. Why is
it needed if you are feeding the output to send-email?
I think it is a case of --thread being added for people not using
send-email, and then getting it misused. I am just trying to add a
sanity check to send-email in case the user does something silly (though
one could certainly argue that it is already hopelessly tied to
git-format-patch, and fixing git-format-patch is the right way to go).
I wonder if stripping existing "Message-Id:" away just like we strip
away "Date:" from @xh would be a much saner fix.
That is definitely wrong if we expect to re-use the in-reply-to and
references headers that already exist (though obviously we could strip
out all three of those headers and re-add our own).
I don't have a strong opinion. I never use git-send-email myself, but
was just trying to fix a reported bug.
-Peff
On Mon, Dec 17, 2007 at 06:05:58PM -0500, Jeff King wrote:
quoted
I wonder if stripping existing "Message-Id:" away just like we strip
away "Date:" from @xh would be a much saner fix.
That is definitely wrong if we expect to re-use the in-reply-to and
references headers that already exist (though obviously we could strip
out all three of those headers and re-add our own).
I don't have a strong opinion. I never use git-send-email myself, but
was just trying to fix a reported bug.
Actually, I don't think stripping the message-id is ever the right
thing. The user put it in there for some purpose, and "ours not to
reason why" (ours but to do and die). IOW, it is not possible for us to
know what we are breaking by changing the message-id. It could simply be
the reply-to header in the following messages, or it could be the
reply-to in some message we have not and will not ever see.
Even if we assume git-send-email only ever gets the unmunged output of
git-format-patch, we do not necessarily know it has been fed all of the
patches during a single run.
-Peff
Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Ah. The problem is that git-send-email unconditionally adds a
message-id. Usually git-format-patch doesn't add one, but for obvious
reasons, it must when doing --thread. Here is a fix.
quoted
diff --git a/git-send-email.perl b/git-send-email.perl
index 1d6f466..083466a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -580,7 +580,7 @@ sub send_message
$ccline = "\nCc: $cc";
}
my $sanitized_sender = sanitize_address($sender);
- make_message_id();
+ make_message_id() unless defined($message_id);
Isn't this called inside a loop? If the outgoing message does not
originally have "Message-Id:", does the loop correctly reinitialize
$message_id to undef, or does this change make everybody reuse the same
$message_id over and over again?
I have a feeling that --thread to format-patch is a misfeature. Why is
it needed if you are feeding the output to send-email?
I added that option; see (d1566f7883f727f38bf442af3fdb69d36e6fcea2,
cc35de8470541e389b7d2bdda4c901574720fa81, and
da56645dd7c1175fc2ed1628ac35fdd35e705641). I use git-imap-send, not
git-send-email, and I wanted to thread my patches.
- Josh Triplett
Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Ah. The problem is that git-send-email unconditionally adds a
message-id. Usually git-format-patch doesn't add one, but for obvious
reasons, it must when doing --thread. Here is a fix.
quoted
diff --git a/git-send-email.perl b/git-send-email.perl
index 1d6f466..083466a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -580,7 +580,7 @@ sub send_message
$ccline = "\nCc: $cc";
}
my $sanitized_sender = sanitize_address($sender);
- make_message_id();
+ make_message_id() unless defined($message_id);
Isn't this called inside a loop? If the outgoing message does not
originally have "Message-Id:", does the loop correctly reinitialize
$message_id to undef, or does this change make everybody reuse the same
$message_id over and over again?
I have a feeling that --thread to format-patch is a misfeature. Why is
it needed if you are feeding the output to send-email?
I added that option; see (d1566f7883f727f38bf442af3fdb69d36e6fcea2,
cc35de8470541e389b7d2bdda4c901574720fa81, and
da56645dd7c1175fc2ed1628ac35fdd35e705641). I use git-imap-send, not
git-send-email, and I wanted to thread my patches.
- Josh Triplett