{"thread":{"id":"6926","subject":"strange date generated by git-format-patch","startedAt":"2007-02-23T08:55:51Z","lastAt":"2007-02-24T23:19:28Z","messageCount":7,"participants":["johan defries","Junio C Hamano","Johannes Schindelin","Theodore Tso","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"35312","messageId":"38d46eb0702230055i587bc775r9362aafeef803976@mail.gmail.com","threadId":"6926","inReplyTo":null,"subject":"strange date generated by git-format-patch","fromName":"johan defries","fromEmail":"johandefries@gmail.com","sentAt":"2007-02-23T08:55:51Z","receivedAt":"2007-02-23T08:55:51Z","isPatch":false,"sender":{"key":"johandefries@gmail.com","avatar":null},"body":"When I do\n\n#git-format-patch --stdout HEAD^|head -1 | grep --color \"Mon Sep 17\n00:00:00 2001\"\n\nI really get a hit. \"Sept 17 2001\"?? It's strange, because the\nrepository is so much younger.\n\nCan someone explain?\n\nThank you.\n"},{"id":"35313","messageId":"7vtzxd6y9h.fsf@assigned-by-dhcp.cox.net","threadId":"6926","inReplyTo":"38d46eb0702230055i587bc775r9362aafeef803976@mail.gmail.com","subject":"Re: strange date generated by git-format-patch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-23T09:04:10Z","receivedAt":"2007-02-23T09:04:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"johan defries\" <johandefries@gmail.com> writes:\n\n> When I do\n>\n> #git-format-patch --stdout HEAD^|head -1 | grep --color \"Mon Sep 17\n> 00:00:00 2001\"\n>\n> I really get a hit. \"Sept 17 2001\"?? It's strange, because the\n> repository is so much younger.\n\nThat is just a fake random date to make the Unix-From line\nrecognizable by common MUA and does not have anything to do with\nyour commit objects.\n\nThe real date is on Date: header.\n"},{"id":"35324","messageId":"Pine.LNX.4.63.0702231558170.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6926","inReplyTo":"7vtzxd6y9h.fsf@assigned-by-dhcp.cox.net","subject":"Re: strange date generated by git-format-patch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-23T14:59:08Z","receivedAt":"2007-02-23T14:59:08Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 23 Feb 2007, Junio C Hamano wrote:\n\n> \"johan defries\" <johandefries@gmail.com> writes:\n> \n> > When I do\n> >\n> > #git-format-patch --stdout HEAD^|head -1 | grep --color \"Mon Sep 17\n> > 00:00:00 2001\"\n> >\n> > I really get a hit. \"Sept 17 2001\"?? It's strange, because the\n> > repository is so much younger.\n> \n> That is just a fake random date to make the Unix-From line recognizable \n> by common MUA and does not have anything to do with your commit objects.\n\nSo how about this:\n-- snipsnap --\n[PATCH] pretty=email: use current date for \"From <sha1>\" lines\n\nTo keep MUAs happy, we have to provide a date in mbox files. These\ndates are supposed to mark the date of arrival, so take \"now\"\ninstead of some made-up date.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n log-tree.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/log-tree.c b/log-tree.c\nindex ac86194..b6e1ad2 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -174,7 +174,7 @@ void show_log(struct rev_info *opt, const char *sep)\n \t\telse\n \t\t\tsubject = \"Subject: \";\n \n-\t\tprintf(\"From %s Mon Sep 17 00:00:00 2001\\n\", sha1);\n+\t\tprintf(\"From %s %s\\n\", sha1, show_date(time(NULL), 0, 0));\n \t\tif (opt->message_id)\n \t\t\tprintf(\"Message-Id: <%s>\\n\", opt->message_id);\n \t\tif (opt->ref_message_id)\n"},{"id":"35390","messageId":"7vodnjzyvq.fsf@assigned-by-dhcp.cox.net","threadId":"6926","inReplyTo":"Pine.LNX.4.63.0702231558170.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: strange date generated by git-format-patch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-24T09:30:17Z","receivedAt":"2007-02-24T09:30:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> That is just a fake random date to make the Unix-From line recognizable \n>> by common MUA and does not have anything to do with your commit objects.\n>\n> So how about this:\n\n> @@ -174,7 +174,7 @@ void show_log(struct rev_info *opt, const char *sep)\n>  \t\telse\n>  \t\t\tsubject = \"Subject: \";\n>  \n> -\t\tprintf(\"From %s Mon Sep 17 00:00:00 2001\\n\", sha1);\n> +\t\tprintf(\"From %s %s\\n\", sha1, show_date(time(NULL), 0, 0));\n\nI actually once tried to change it to git's birthday (Thu Apr 7\n15:13:13 2005 -0700) and I recall that it turned out that some\npeople's scripts (or perhaps MUA) were broken and cared what was\nbefore \"7\" (nothing, as show_date() does, \" \" to align to two\ncolumns per date, \"0\" to zero-pad align) on the Unix-From line\nand discarded that update.\n\nI do not think it is worth changing it.  Who's hurting with the\ncurrent behaviour?  In other words, is it broken?  Unix-From\nlines are there only to separate each piece of e-mail in the\nmbox and otherwise is not used.  send-email, am, nor imap-send\nshould care anything beyond the leading \"From \", and mailsplit\nvalidates only that what's around the last colon near the end of\nline looks like time and year.\n"},{"id":"35396","messageId":"20070224130839.GC4380@thunk.org","threadId":"6926","inReplyTo":"7vodnjzyvq.fsf@assigned-by-dhcp.cox.net","subject":"Re: strange date generated by git-format-patch","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-02-24T13:08:39Z","receivedAt":"2007-02-24T13:08:39Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Sat, Feb 24, 2007 at 01:30:17AM -0800, Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> That is just a fake random date to make the Unix-From line recognizable \n> >> by common MUA and does not have anything to do with your commit objects.\n> >\n> I do not think it is worth changing it.  Who's hurting with the\n> current behaviour?  In other words, is it broken?  Unix-From\n> lines are there only to separate each piece of e-mail in the\n> mbox and otherwise is not used.  send-email, am, nor imap-send\n> should care anything beyond the leading \"From \", and mailsplit\n> validates only that what's around the last colon near the end of\n> line looks like time and year.\n\nThe only potential problem with it is that some MUA's (like mutt for\nexample) sort by the From date by default.  You can force it to list\nthe patches in an unsorted order (via 'Ou'), but it might be nice if\nthe patches date in the From field was the date that the patches were\ngenerated, with the seconds field bumped so that the patches in a\nseries were guaranteed to have monotonically increasing dates.  It's\nonly a minor point, though.\n\n\t\t\t\t\t\t- Ted\n"},{"id":"35402","messageId":"20070224185150.GB2646@coredump.intra.peff.net","threadId":"6926","inReplyTo":"20070224130839.GC4380@thunk.org","subject":"Re: strange date generated by git-format-patch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-02-24T18:51:50Z","receivedAt":"2007-02-24T18:51:50Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Feb 24, 2007 at 08:08:39AM -0500, Theodore Tso wrote:\n\n> The only potential problem with it is that some MUA's (like mutt for\n> example) sort by the From date by default.  You can force it to list\n> the patches in an unsorted order (via 'Ou'), but it might be nice if\n\nThat's not true; mutt sorts by date by default, but it pulls the default\nfrom the \"Date\" header, which git correctly sets to the author timestamp.\nYou can convince mutt to look at the date in the 'From' line using a\n'date-received' sort, but I don't know that it was ever the default.\n\n-Peff\n"},{"id":"35405","messageId":"Pine.LNX.4.63.0702250010080.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6926","inReplyTo":"7vodnjzyvq.fsf@assigned-by-dhcp.cox.net","subject":"Re: strange date generated by git-format-patch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-24T23:19:28Z","receivedAt":"2007-02-24T23:19:28Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 24 Feb 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> That is just a fake random date to make the Unix-From line \n> >> recognizable by common MUA and does not have anything to do with your \n> >> commit objects.\n> >\n> > So how about this:\n> \n> > @@ -174,7 +174,7 @@ void show_log(struct rev_info *opt, const char *sep)\n> >  \t\telse\n> >  \t\t\tsubject = \"Subject: \";\n> >  \n> > -\t\tprintf(\"From %s Mon Sep 17 00:00:00 2001\\n\", sha1);\n> > +\t\tprintf(\"From %s %s\\n\", sha1, show_date(time(NULL), 0, 0));\n> \n> I actually once tried to change it to git's birthday (Thu Apr 7\n> 15:13:13 2005 -0700) and I recall that it turned out that some\n> people's scripts (or perhaps MUA) were broken and cared what was\n> before \"7\" (nothing, as show_date() does, \" \" to align to two\n> columns per date, \"0\" to zero-pad align) on the Unix-From line\n> and discarded that update.\n\nI only found out now (after some Googling, instigated by your reply) that \nthe mbox format is _borked_. There seem to be so many variants, and I \nerroneously assumed that if it works in pine, it works everywhere...\n\n> I do not think it is worth changing it.  Who's hurting with the\n> current behaviour?  In other words, is it broken?\n\nYou can order by arrived-date. But that is such a minor issue that I agree \nnothing needs to be changed.\n\nCiao,\nDscho\n"}]}