Skip to contentSkip to conversation

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

PATCH In review Eric Wong 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 git-send-email: do not pass custom Date: header

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.

---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-send-email.perl +1 -1
index 1c6d2cc..c42dc3b 100755
@@ -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, $_;
 				}
 
Signature · 1 line
1.4.3.1.g3e3bc
#1 lore raw
Quoted 9 lines · Eric Wong

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.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
author
#2 lore raw
Quoted 7 lines · Jakub Narebski
Quoted 5 lines · Eric Wong

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:

Quoted 7 lines
Quoted 4 lines

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.

Signature · 1 line
Eric Wong
#3 lore raw
Quoted 13 lines · Eric Wong
Quoted 12 lines · Jakub Narebski
Quoted 9 lines · Eric Wong

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.

Quoted 5 lines
Quoted 2 lines

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.