[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] add date header in commit-email.pl

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-02-10 02:18:38 CET

On Wed, 31 Jan 2007, Stefan Reinauer wrote:

> commit-email.pl does not add a date header to the mails
> it sends out. This looks ugly in some mail clients, such
> as Mozilla Thunderbird, because the mails are shown to
> be written on 1970-01-01.

--- commit-email.pl.in.orig 2006-04-20 01:08:55.000000000 +0200
+++ commit-email.pl.in 2007-01-30 16:11:30.000000000 +0100
@@ -38,6 +38,7 @@
 
 use strict;
 use Carp;
+use Date::Format;

I don't have this module installed by default on my FC6 system. Is
there any reason not to use the strftime() routine from the POSIX
module (e.g. is it available on Windows), as suggested by 'man
perlfunc'?

 my ($sendmail, $smtp_server);
 
 ######################################################################
@@ -537,6 +538,9 @@
       }
 
     my @head;
+ my @lt=localtime();
          ^ ^
Need additional whitespace.

+ my $header_date = strftime("%a, %e %b %Y %X %z", @lt);
+ push(@head, "Date: $header_date\n");
     push(@head, "To: $to\n");
     push(@head, "From: $mail_from\n");
     push(@head, "Subject: $subject\n");

  • application/pgp-signature attachment: stored
Received on Sat Feb 10 02:19:02 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.