threads / patch / 6008

patchgit-send-email: do not pass custom Date: header

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

## tl;dr

4 messages between Oct 23, 2006 and Oct 24, 2006. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Eric Wong· Oct 23, 2006, 07:46 UTC · lore

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(-)
Show changes to git-send-email.perl +1 −1
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· Oct 23, 2006, 08:41 UTC · re: Eric Wong · lore

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

Eric Wong wrote:
Show 9 quoted lines
> 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· Oct 23, 2006, 09:38 UTC · re: Jakub Narebski · lore

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

Jakub Narebski <jnareb@gmail.com> wrote:
Show 14 quoted lines
> 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· Oct 24, 2006, 06:46 UTC · re: Eric Wong · lore

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

Eric Wong <normalperson@yhbt.net> writes:
Show 18 quoted lines
> 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.

← back to recent threads