You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Reinauer <st...@coresystems.de> on 2007/01/31 10:07:33 UTC

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

Hi,

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.

Since I did not know of any good reason not to have that 
header, I made a tiny patch to add it. I'd be glad if someone
else has use for this.

Best regards,
Stefan

-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info@coresystems.de  • http://www.coresystems.de/

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.
...

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

Posted by Daniel Rall <dl...@collab.net>.
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");