# [PATCH] git-send-email: do not pass custom Date: header

4 messages from 2006-10-23 to 2006-10-24. Participants: Eric Wong, Jakub Narebski, Junio C Hamano.
Thread: https://gitlist.dev/t/6008

## Eric Wong, 2006-10-23 07:46

Subject: [PATCH] git-send-email: do not pass custom Date: header
Message-ID: <11615895973387-git-send-email-normalperson@yhbt.net>
URL: https://gitlist.dev/e/11615895973387-git-send-email-normalperson%40yhbt.net

```
We already generate a Date: header based on when the patch was
emailed.  git-format-patch includes the Date: header of the
patch.  Having two Date: headers is just confusing, so we
just use the current Date:

Often the mailed patches in a patch series are created over a
series of several hours or days, so the Date: header from the
original commit is incorrect for email, and often far off enough
for spam filters to complain.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 1c6d2cc..c42dc3b 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -514,7 +514,7 @@ foreach my $t (@files) {
 						$2, $_) unless $quiet;
 					push @cc, $2;
 				}
-				elsif (/^[-A-Za-z]+:\s+\S/) {
+				elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) {
 					push @xh, $_;
 				}
 
-- 
1.4.3.1.g3e3bc

```

## Jakub Narebski, 2006-10-23 08:41

Subject: Re: [PATCH] git-send-email: do not pass custom Date: header
Message-ID: <ehhv6g$4js$1@sea.gmane.org>
URL: https://gitlist.dev/e/ehhv6g%244js%241%40sea.gmane.org
In-Reply-To: <11615895973387-git-send-email-normalperson@yhbt.net>

```
Eric Wong wrote:

> We already generate a Date: header based on when the patch was
> emailed.  git-format-patch includes the Date: header of the
> patch.  Having two Date: headers is just confusing, so we
> just use the current Date:
> 
> Often the mailed patches in a patch series are created over a
> series of several hours or days, so the Date: header from the
> original commit is incorrect for email, and often far off enough
> for spam filters to complain.

But that makes us lose original commit date. And git format-patch
is if I remember correctly together with git-am used in git-rebase.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Eric Wong, 2006-10-23 09:38

Subject: Re: [PATCH] git-send-email: do not pass custom Date: header
Message-ID: <20061023093824.GB8749@localdomain>
URL: https://gitlist.dev/e/20061023093824.GB8749%40localdomain
In-Reply-To: <ehhv6g$4js$1@sea.gmane.org>

```
Jakub Narebski <jnareb@gmail.com> wrote:
> Eric Wong wrote:
> 
> > We already generate a Date: header based on when the patch was
> > emailed. ?git-format-patch includes the Date: header of the
> > patch. ?Having two Date: headers is just confusing, so we
> > just use the current Date:
> > 
> > Often the mailed patches in a patch series are created over a
> > series of several hours or days, so the Date: header from the
> > original commit is incorrect for email, and often far off enough
> > for spam filters to complain.
> 
> But that makes us lose original commit date. And git format-patch
> is if I remember correctly together with git-am used in git-rebase.

This patch is for git-send-email, and only affects the way they
are sent over SMTP.  Output of git-format-patch is unchanged.

-- 
Eric Wong

```

## Junio C Hamano, 2006-10-24 06:46

Subject: Re: [PATCH] git-send-email: do not pass custom Date: header
Message-ID: <7vr6wyqkh3.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vr6wyqkh3.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20061023093824.GB8749@localdomain>

```
Eric Wong <normalperson@yhbt.net> writes:

> Jakub Narebski <jnareb@gmail.com> wrote:
>> Eric Wong wrote:
>> 
>> > We already generate a Date: header based on when the patch was
>> > emailed. ?git-format-patch includes the Date: header of the
>> > patch. ?Having two Date: headers is just confusing, so we
>> > just use the current Date:
>> > 
>> > Often the mailed patches in a patch series are created over a
>> > series of several hours or days, so the Date: header from the
>> > original commit is incorrect for email, and often far off enough
>> > for spam filters to complain.
>> 
>> But that makes us lose original commit date. And git format-patch
>> is if I remember correctly together with git-am used in git-rebase.
>
> This patch is for git-send-email, and only affects the way they
> are sent over SMTP.  Output of git-format-patch is unchanged.

An alternative to satisfy both (Jakub wants original author date
propagated to the recipient of the e-mail who will run "git-am"
to apply the patch; you do not want to throw potentially ancient
author date as the e-mail's Date: to SMTP layer) is to use
sending date in e-mail header (like your patch does) _and_ leave
the Date: header for the original author date as the first line
of the e-mail message, separated with the real body of the message
with a blank line.

```
