You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Rall <dl...@collab.net> on 2007/02/10 01:18:38 UTC

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

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");


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

Posted by Daniel Rall <dl...@collab.net>.
Stefan, thanks for the patch.  Things have changed a little bit in the
code, but I've committed the gist of it to Subversion's trunk in
r23461 and r23376.

- dan

On Sat, 10 Feb 2007, Stefan Reinauer wrote:

> Dear Daniel,
> 
> thank you very much for your feedback.
> 
> Daniel Rall wrote:
> > 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.
...