* [PATCH] git-send-email: bikeshed Message-ID generation
@ 2015-09-06 9:23 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-09-06 9:23 UTC (permalink / raw)
To: spew; +Cc: Eric Wong
This makes for shorter, more sensible URLs in public-inbox
Signed-off-by: Eric Wong <e@80x24.org>
---
git-send-email.perl | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index c5a3f76..cb61773 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -929,7 +929,8 @@ my ($message_id_stamp, $message_id_serial);
sub make_message_id {
my $uniq;
if (!defined $message_id_stamp) {
- $message_id_stamp = sprintf("%s-%s", time, $$);
+ use POSIX qw/strftime/;
+ $message_id_stamp = strftime("%Y%m%d%H%M%S.$$", gmtime(time));
$message_id_serial = 0;
}
$message_id_serial++;
@@ -944,7 +945,7 @@ sub make_message_id {
require Sys::Hostname;
$du_part = 'user@' . Sys::Hostname::hostname();
}
- my $message_id_template = "<%s-git-send-email-%s>";
+ my $message_id_template = "<%s-%s>";
$message_id = sprintf($message_id_template, $uniq, $du_part);
#print "new message id = $message_id\n"; # Was useful for debugging
}
--
EW
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-06 9:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-06 9:23 [PATCH] git-send-email: bikeshed Message-ID generation Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).