Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] include/asm-arm/: Spelling fixes

From: Jeff King <hidden>
Date: 2016-06-15 22:44:00
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

On Mon, Dec 17, 2007 at 12:22:51PM -0800, Joe Perches wrote:
$ let count=0 ; for line in $(cat patch_order) ; do ((count++)); \
	printf -v tmp "%04u-Spelling-%s" $count $line ; \
	tmp=${tmp//\//-} ; tmp=${tmp// /}; \
	git-format-patch -N --thread --start-number $count -s \
	-o patch3 \
	--subject-prefix="[PATCH] Spelling: $line" master $line  ; done
[converted the subjects appropriately]
$ git-send-email --smtp-server <foo> --smtp-user <bar> \
	--from "Joe Perches [off-list ref]" \
	--to "linux-kernel@vger.kernel.org" \
	--cc "Andrew Morton [off-list ref]" \
	--cc-cmd "../get_maintainer.pl --nogit" \
	--no-thread --suppress-from patch3
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.

-- >8 --
git-send-email: avoid duplicate message-ids

We used to unconditionally add a message-id to the outgoing
email without bothering to check if it already had one.
Instead, let's use the existing one.

Signed-off-by: Jeff King <redacted>
---
It will also happily add duplicate --in-reply-to and --references
headers, but those can be suppressed with --no-thread. Arguably, it
should detect this case and turn on --no-thread, but looking at
git-send-email makes me want to claw my eyes out.

 git-send-email.perl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
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);
 
 	my $header = "From: $sanitized_sender
 To: $to${ccline}
@@ -718,6 +718,9 @@ foreach my $t (@files) {
 					}
 					push @xh, $_;
 				}
+				elsif (/^Message-Id: (.*)/i) {
+					$message_id = $1;
+				}
 				elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) {
 					push @xh, $_;
 				}
-- 
1.5.4.rc0.1146.gc97f-dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help