dumping ground for random patches and texts
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: spew@80x24.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH] git-send-email: bikeshed Message-ID generation
Date: Sun,  6 Sep 2015 09:23:30 +0000	[thread overview]
Message-ID: <20150906092330.2015-1-normalperson@yhbt.net> (raw)

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


                 reply	other threads:[~2015-09-06  9:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150906092330.2015-1-normalperson@yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=e@80x24.org \
    --cc=spew@80x24.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).