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

[PATCH] send-email: try to order messages in email clients more correctly

From
EWEric Wong <normalperson@yhbt.net>
Date
Mar 25, 2006, 11:01 UTC
Message-ID
<11432844613551-git-send-email-normalperson@yhbt.net>

If --no-chain-reply-to is set, patches may not always be ordered correctly in email clients. This patch makes sure each email sent from a different second.

I chose to start with a time (slightly) in the past because those are probably more likely in real-world usage and spam filters might be more tolerant of them.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-send-email.perl |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
695849a185ee8cfc8f3df0c737ff16a04cc84a5b
diff --git a/git-send-email.perl b/git-send-email.perl
index 207b1fb..de635ed 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -37,7 +37,7 @@ sub cleanup_compose_files();
 my $compose_filename = ".msg.$$";
 
 # Variables we fill in automatically, or via prompting:
-my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose);
+my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
 
 # Behavior modification variables
 my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);
@@ -295,13 +295,14 @@ sub make_message_id
 
 
 $cc = "";
+$time = time - scalar $#files;
 
 sub send_message
 {
 	my @recipients = unique_email_list(@to);
 	my $to = join (",\n\t", @recipients);
 	@recipients = unique_email_list(@recipients,@cc);
-	my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime(time));
+	my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));
 
 	my $header = "From: $from
 To: $to
-- 
1.2.4.gb622a
Message 1 of 1 in “send-email: try to order messages in email clients more correctly”
  1. send-email: try to order messages in email clients more correctlyEric Wong, Mar 25, 2006

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.