{"thread":{"id":"47703","subject":"git send-email sets date","startedAt":"2018-01-27T21:12:01Z","lastAt":"2018-01-30T20:41:36Z","messageCount":8,"participants":["Michal Suchánek","brian m. carlson","Philip Oakley","Theodore Ts'o","Ævar Arnfjörð Bjarmason","Eric Wong","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"337581","messageId":"20180126183230.0ae0c76b@kitsune.suse.cz","threadId":"47703","inReplyTo":null,"subject":"git send-email sets date","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2018-01-26T17:32:30Z","receivedAt":"2018-01-27T21:12:01Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"Hello,\n\ngit send-email sets the message date to author date.\n\nThis is wrong because the message will most likely not get delivered\nwhen the author date differs from current time. It might give slightly\nbetter results with commit date instead of author date but can't is\njust skip that header and leave it to the mailer?\n\nIt does not even seem to have an option to suppress adding the date\nheader.\n\nThanks\n\nMichal\n"},{"id":"337606","messageId":"20180128151536.GE431130@genre.crustytoothpaste.net","threadId":"47703","inReplyTo":"20180126183230.0ae0c76b@kitsune.suse.cz","subject":"Re: git send-email sets date","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-01-28T15:15:36Z","receivedAt":"2018-01-28T15:15:54Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Fri, Jan 26, 2018 at 06:32:30PM +0100, Michal Suchánek wrote:\n> git send-email sets the message date to author date.\n> \n> This is wrong because the message will most likely not get delivered\n> when the author date differs from current time. It might give slightly\n> better results with commit date instead of author date but can't is\n> just skip that header and leave it to the mailer?\n> \n> It does not even seem to have an option to suppress adding the date\n> header.\n\nI'm pretty sure it's intended to work this way.\n\nWithout the Date header, we have no way of providing the author date\nwhen sending a patch.  git am will read this date and use it as the\nauthor date when applying patches, so if it's omitted, the author date\nwill be wrong.\n\nIf you want to send patches with a different date, you can always insert\nthe patch inline in your mailer using the scissors notation, which will\nallow your mailer to insert its own date while keeping the patch date\nseparate.\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\nhttps://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"337610","messageId":"001601d39850$a0a48ae0$e1eda0a0$@iee.org","threadId":"47703","inReplyTo":"20180128151536.GE431130@genre.crustytoothpaste.net","subject":"RE: git send-email sets date","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2018-01-28T15:57:03Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Behalf Of brian m. carlson\n> On Fri, Jan 26, 2018 at 06:32:30PM +0100, Michal Suchánek wrote:\n> > git send-email sets the message date to author date.\n> >\n> > This is wrong because the message will most likely not get delivered\n> > when the author date differs from current time. It might give slightly\n> > better results with commit date instead of author date but can't is\n> > just skip that header and leave it to the mailer?\n> >\n> > It does not even seem to have an option to suppress adding the date\n> > header.\n> \n> I'm pretty sure it's intended to work this way.\n> \n> Without the Date header, we have no way of providing the author date\n> when sending a patch.  git am will read this date and use it as the\n> author date when applying patches, so if it's omitted, the author date\n> will be wrong.\n> \n> If you want to send patches with a different date, you can always insert\n> the patch inline in your mailer using the scissors notation, which will\n> allow your mailer to insert its own date while keeping the patch date\n> separate.\n> --\n\nMichal, you may want to hack up an option that can automatically create \nthat format if it is of use. I sometimes find the sort order an issue in \nsome of my mail clients.\n--\nPhilip\n\n"},{"id":"337642","messageId":"20180128221231.GB13621@thunk.org","threadId":"47703","inReplyTo":"001601d39850$a0a48ae0$e1eda0a0$@iee.org","subject":"Re: git send-email sets date","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2018-01-28T22:12:31Z","receivedAt":"2018-01-28T22:23:28Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Sun, Jan 28, 2018 at 03:56:57PM -0000, Philip Oakley wrote:\n> Michal, you may want to hack up an option that can automatically create \n> that format if it is of use. I sometimes find the sort order an issue in \n> some of my mail clients.\n\nIf there is a From: header in the beginning of the mail body, it is\nused as the Author instead of the From: header in the mail header.  It\nwould make sense if there is a Date: header in the beginning of the\nmail body, it should be used instead of Date: field in the mail header.\n\nThe problem is that if existing git clients don't support this, it\nwouldn't be safe to start emmiting patches with that format for at\nleast a year or two until the prerequisite version of git gets wide\nadoption.  Alternatively, there could be a git option which causes\nsomething like X-Git-Author-Date: to be set in the mail header.\n\n\t       \t\t\t  \t   \t- Ted\n"},{"id":"337643","messageId":"CACBZZX7W4n9Q-uL0t1W1dttAxA=hU69fL9Tqsfe0wj5XP=O44w@mail.gmail.com","threadId":"47703","inReplyTo":"20180126183230.0ae0c76b@kitsune.suse.cz","subject":"Re: git send-email sets date","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-01-28T22:32:08Z","receivedAt":"2018-01-28T22:32:38Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Jan 26, 2018 at 6:32 PM, Michal Suchánek <msuchanek@suse.de> wrote:\n> This is wrong because the message will most likely not get delivered\n> when the author date differs from current time.\n\nOthers have covered other bases here, but I just wanted to ask about\nthis. Are there really mail setups that refuse to deliver or accept\nmessages whose Date headers don't match what the expect? I would think\nthat such issues wouldn't be present in the wild since SMTP daemons\nneed to deal with messages that are e.g. held locally somewhere, or\nthe only make it to your server days afterwards due to your own\ndowntime + client retries.\n\nNow if by \"not get delivered\" you mean they'll show up on the Nth page\nof your mailer because it sorts by the Date header, sure. That's a\nproblem and quite common, tricky to solve due to the issues others\nhave noted though.\n"},{"id":"337659","messageId":"20180129124835.ngeywe7qstmzx555@untitled","threadId":"47703","inReplyTo":"CACBZZX7W4n9Q-uL0t1W1dttAxA=hU69fL9Tqsfe0wj5XP=O44w@mail.gmail.com","subject":"Re: git send-email sets date","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2018-01-29T12:48:35Z","receivedAt":"2018-01-29T12:48:40Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> On Fri, Jan 26, 2018 at 6:32 PM, Michal Suchánek <msuchanek@suse.de> wrote:\n> > This is wrong because the message will most likely not get delivered\n> > when the author date differs from current time.\n\nEven by a few seconds?  I guess it depends on how many patches\nyou're sending at once.  It uses number of patches to set Date:\nheader:\n\n\t$time = time - scalar $#files;\n\t(and does $time++ for each patch)\n\n> Others have covered other bases here, but I just wanted to ask about\n> this. Are there really mail setups that refuse to deliver or accept\n> messages whose Date headers don't match what the expect? I would think\n> that such issues wouldn't be present in the wild since SMTP daemons\n> need to deal with messages that are e.g. held locally somewhere, or\n> the only make it to your server days afterwards due to your own\n> downtime + client retries.\n\nHaving a Date that's far off is one of many indicators used to\ndetermine spam.  SpamAssassin has a rules and scores which do\nthis, but it looks like the smallest one is for 3 and 6 hours\nin the past (DATE_IN_PAST_03_06) so one would need 10800 patches\nto trigger it (!?)\n\nI definitely had problems back in the day with author date\nbeing used as the Date: header, see:\n\n\tcommit 1d6a003a42b3c23ad7883b0bbe6a034728e51836\n\t(\"git-send-email: do not pass custom Date: header\")\n"},{"id":"337807","messageId":"xmqqo9lbt75o.fsf@gitster-ct.c.googlers.com","threadId":"47703","inReplyTo":"20180126183230.0ae0c76b@kitsune.suse.cz","subject":"Re: git send-email sets date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-01-30T20:37:23Z","receivedAt":"2018-01-30T20:37:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michal Suchánek <msuchanek@suse.de> writes:\n\n> git send-email sets the message date to author date.\n>\n> This is wrong because the message will most likely not get delivered\n> when the author date differs from current time. It might give slightly\n> better results with commit date instead of author date but can't is\n> just skip that header and leave it to the mailer?\n>\n> It does not even seem to have an option to suppress adding the date\n> header.\n\nI think you are complaining about output from \"git format-patch\",\nand the reason why the date header is recorded in the output is as\nothers already mentioned in this thread.\n\nThe complaint about \"delivery\" is misplaced because that date is not\nused to drive the SMTP conversation in any way.  \"git send-email\"\ndoes create its own timestamp, but that is based on the current time\nand does not have anything to do with the author or committer date\nof the original commit the patch message came from.  \n\nI think we confused end-users like you by allowing the command to\ndrive \"git format-patch\" from the command line (and worse, somehow\nappearing to encourage such use), which probably was a UI mistake.\nWe should encourage people to run two commands separately instead,\nwhich incidentally will allow the patch messages to be proofread for\nthe last time before they are sent out, but also reduce this\nconfusion when users see that these dates from the author timestamp\nare not used in the \"Date:\" header of received e-mails.\n"},{"id":"337808","messageId":"xmqqk1vzt6yv.fsf@gitster-ct.c.googlers.com","threadId":"47703","inReplyTo":"20180128221231.GB13621@thunk.org","subject":"Re: git send-email sets date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-01-30T20:41:28Z","receivedAt":"2018-01-30T20:41:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Theodore Ts'o <tytso@mit.edu> writes:\n\n> If there is a From: header in the beginning of the mail body, it is\n> used as the Author instead of the From: header in the mail header.  It\n> would make sense if there is a Date: header in the beginning of the\n> mail body, it should be used instead of Date: field in the mail header.\n\nJust like From:, Date: and Subject: are in-body headers that are\naccepted by deployed versions of \"git am\" (actually, \"mailinfo\").\n\n"}]}