summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-05-02 14:24:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-05-02 14:24:04 -0700
commitffaa7c5d4f064ae2ce6b0ea906bd240810ecee86 (patch)
treeabb728a3228d128f8bb95c9cf36599341194d62f /git-send-email.perl
parentGit 2.8.2 (diff)
parentsend-email: more meaningful Message-ID (diff)
downloadtgif-ffaa7c5d4f064ae2ce6b0ea906bd240810ecee86.tar.xz
Merge branch 'ew/send-email-readable-message-id' into maint
"git send-email" now uses a more readable timestamps when formulating a message ID. * ew/send-email-readable-message-id: send-email: more meaningful Message-ID
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index c45b22a19a..bc74ec979e 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -19,6 +19,7 @@
use 5.008;
use strict;
use warnings;
+use POSIX qw/strftime/;
use Term::ReadLine;
use Getopt::Long;
use Text::ParseWords;
@@ -949,7 +950,7 @@ 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, $$);
+ $message_id_stamp = strftime("%Y%m%d%H%M%S.$$", gmtime(time));
$message_id_serial = 0;
}
$message_id_serial++;
@@ -964,7 +965,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
}