{"thread":{"id":"8465","subject":"[PATCH] Accept dates before 2000/01/01 when specified as seconds since the epoch","startedAt":"2007-06-06T08:11:55Z","lastAt":"2007-06-07T05:30:23Z","messageCount":6,"participants":["Johannes Sixt","Junio C Hamano","Sam Vilain","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"44136","messageId":"11811175153355-git-send-email-johannes.sixt@telecom.at","threadId":"8465","inReplyTo":null,"subject":"[PATCH] Accept dates before 2000/01/01 when specified as seconds since the epoch","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2007-06-06T08:11:55Z","receivedAt":"2007-06-06T08:11:55Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Tests with git-filter-branch on a repository that was converted from\nCVS and that has commits reaching back to 1999 revealed that it is\nnecessary to parse dates before 2000/01/01 when they are specified\nas seconds since 1970/01/01. There is now still a limit, 100000000,\nwhich is 1973/03/03 09:46:40 UTC, in order to allow that dates are\nrepresented as 8 digits.\n\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n date.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/date.c b/date.c\nindex a9b59a2..4690371 100644\n--- a/date.c\n+++ b/date.c\n@@ -414,9 +414,11 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt\n \tnum = strtoul(date, &end, 10);\n \n \t/*\n-\t * Seconds since 1970? We trigger on that for anything after Jan 1, 2000\n+\t * Seconds since 1970? We trigger on that for any numbers with\n+\t * more than 8 digits. This is because we don't want to rule out\n+\t * numbers like 20070606 as a YYYYMMDD date.\n \t */\n-\tif (num > 946684800) {\n+\tif (num >= 100000000) {\n \t\ttime_t time = num;\n \t\tif (gmtime_r(&time, tm)) {\n \t\t\t*tm_gmt = 1;\n-- \n1.5.2.1.120.gd732\n"},{"id":"44141","messageId":"7vtztl5vvb.fsf@assigned-by-dhcp.cox.net","threadId":"8465","inReplyTo":"11811175153355-git-send-email-johannes.sixt@telecom.at","subject":"Re: [PATCH] Accept dates before 2000/01/01 when specified as seconds since the epoch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-06T08:29:28Z","receivedAt":"2007-06-06T08:29:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I vaguely recall hitting the same issue soon after date.c was\ndone, and sending in a patch in the same spirit but with\ndifferent implementation (I essentially duplicated that \"seconds\nsince epoch\" without any cutoff as the last ditch fallback) long\ntime ago (this was before I took git over; the patch was rejected).\n\nIt almost makes me wonder if it is better to introduce a special\nsyntax to denote \"seconds since epoch plus timezone offset\" for\nour Porcelain use, instead of keeping this arbitrary cut-off\ndate which nobody can agree on and which forces us to roll back\nfrom time to time.  For one thing, such a syntax would allow us\nto talk about a timestamp before the epoch.\n\nPerhaps\n\n\t\"epoch\" [-+] [0-9]+ \" \" [-+][0-9][0-9][0-9][0-9]\n\n?\n"},{"id":"44159","messageId":"46668FAD.73D1B73F@eudaptics.com","threadId":"8465","inReplyTo":"7vtztl5vvb.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Accept dates before 2000/01/01 when specified as seconds since the epoch","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-06-06T10:42:53Z","receivedAt":"2007-06-06T10:42:53Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano wrote:\n> \n> I vaguely recall hitting the same issue soon after date.c was\n> done, and sending in a patch in the same spirit but with\n> different implementation (I essentially duplicated that \"seconds\n> since epoch\" without any cutoff as the last ditch fallback) long\n> time ago (this was before I took git over; the patch was rejected).\n> \n> It almost makes me wonder if it is better to introduce a special\n> syntax to denote \"seconds since epoch plus timezone offset\" for\n> our Porcelain use, instead of keeping this arbitrary cut-off\n> date which nobody can agree on and which forces us to roll back\n> from time to time.  For one thing, such a syntax would allow us\n> to talk about a timestamp before the epoch.\n> \n> Perhaps\n> \n>         \"epoch\" [-+] [0-9]+ \" \" [-+][0-9][0-9][0-9][0-9]\n> \n> ?\n\nOTOH, the previous limit 2000/01/01 was completely arbitrary, while the\nnew limit 100000000secs has some justification: Numbers with fewer\ndigits could be mistaken as dates.\n\n-- Hannes\n"},{"id":"44226","messageId":"46679320.6000309@vilain.net","threadId":"8465","inReplyTo":"7vtztl5vvb.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Accept dates before 2000/01/01 when specified as seconds since the epoch","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2007-06-07T05:09:52Z","receivedAt":"2007-06-07T05:09:52Z","isPatch":true,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> I vaguely recall hitting the same issue soon after date.c was\n> done, and sending in a patch in the same spirit but with\n> different implementation (I essentially duplicated that \"seconds\n> since epoch\" without any cutoff as the last ditch fallback) long\n> time ago (this was before I took git over; the patch was rejected).\n> \n> It almost makes me wonder if it is better to introduce a special\n> syntax to denote \"seconds since epoch plus timezone offset\" for\n> our Porcelain use, instead of keeping this arbitrary cut-off\n> date which nobody can agree on and which forces us to roll back\n> from time to time.  For one thing, such a syntax would allow us\n> to talk about a timestamp before the epoch.\n> \n> Perhaps\n> \n> \t\"epoch\" [-+] [0-9]+ \" \" [-+][0-9][0-9][0-9][0-9]\n\nProbably a good idea, though it would break cg-admin-rewritehist.  I had\nto make a similar change when working with the Perl history.  Perhaps\nallow both?\n\nThere is a 10 digit ISO forms (YYYYMMDDHH) and a 9 digit form\n(YYYYDDDHH), but these are very rare :)\n\nSam.\n"},{"id":"44230","messageId":"7vbqfsqqmq.fsf@assigned-by-dhcp.cox.net","threadId":"8465","inReplyTo":"46679320.6000309@vilain.net","subject":"Re: [PATCH] Accept dates before 2000/01/01 when specified as seconds since the epoch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-07T05:29:17Z","receivedAt":"2007-06-07T05:29:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sam Vilain <sam@vilain.net> writes:\n\n>> Perhaps\n>> \n>> \t\"epoch\" [-+] [0-9]+ \" \" [-+][0-9][0-9][0-9][0-9]\n>\n> Probably a good idea, though it would break cg-admin-rewritehist.\n\nI was saying \"additionally allow that to express timestamp even\nbefore the epoch\", and existing cg-admin-rewritehist does not\nfeed such a string, so I do not know how the additionally\nallowed format could break it.  Maybe I am missing something?\n\nIn any case, \"timestamps after March 1973\" patch from j6t is\na good change independent from the above one.\n"},{"id":"44231","messageId":"Pine.LNX.4.64.0706070629180.4046@racer.site","threadId":"8465","inReplyTo":"46679320.6000309@vilain.net","subject":"Re: [PATCH] Accept dates before 2000/01/01 when specified as seconds since the epoch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-06-07T05:30:23Z","receivedAt":"2007-06-07T05:30:23Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 7 Jun 2007, Sam Vilain wrote:\n\n> Junio C Hamano wrote:\n> > I vaguely recall hitting the same issue soon after date.c was\n> > done, and sending in a patch in the same spirit but with\n> > different implementation (I essentially duplicated that \"seconds\n> > since epoch\" without any cutoff as the last ditch fallback) long\n> > time ago (this was before I took git over; the patch was rejected).\n> > \n> > It almost makes me wonder if it is better to introduce a special\n> > syntax to denote \"seconds since epoch plus timezone offset\" for\n> > our Porcelain use, instead of keeping this arbitrary cut-off\n> > date which nobody can agree on and which forces us to roll back\n> > from time to time.  For one thing, such a syntax would allow us\n> > to talk about a timestamp before the epoch.\n> > \n> > Perhaps\n> > \n> > \t\"epoch\" [-+] [0-9]+ \" \" [-+][0-9][0-9][0-9][0-9]\n> \n> Probably a good idea, though it would break cg-admin-rewritehist.\n\nFWIW I don't think we have to care that much about cg-admin-rewritehist, \nsince it lives on as git-filter-branch, and we can adapt it as we go.\n\nCiao,\nDscho\n"}]}