git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Dec 17, 2007, 20:51 UTC
Message-ID
<20071217205134.GB2105@coredump.intra.peff.net>
In-Reply-To
<1197922971.27386.32.camel@localhost>
On Mon, Dec 17, 2007 at 12:22:51PM -0800, Joe Perches wrote:
Show 13 quoted lines
> $ 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 <joe@perches.com>" \
> 	--to "linux-kernel@vger.kernel.org" \
> 	--cc "Andrew Morton <akpm@linux-foundation.org>" \
> 	--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 <peff@peff.net>
---
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
Previous: Joe PerchesNext: Junio C Hamano
Message 3 of 9 in “Re: [PATCH] include/asm-arm/: Spelling fixes”
  1. J. Bruce FieldsDec 17, 2007
  2. Joe PerchesDec 17, 2007
  3. Jeff KingDec 17, 2007
  4. Junio C HamanoDec 17, 2007
  5. Jeff KingDec 17, 2007
  6. Jeff KingDec 17, 2007
  7. Junio C HamanoDec 17, 2007
  8. Josh TriplettJan 8, 2008
  9. Josh TriplettJan 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.