{"thread":{"id":"192","subject":"[PATCH] Set AUTHOR_DATE in git-tools","startedAt":"2005-04-21T07:32:16Z","lastAt":"2005-04-27T03:52:06Z","messageCount":3,"participants":["David Woodhouse","Greg KH"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"1104","messageId":"1114068737.29135.17.camel@localhost.localdomain","threadId":"192","inReplyTo":null,"subject":"[PATCH] Set AUTHOR_DATE in git-tools","fromName":"David Woodhouse","fromEmail":"dwmw2@infradead.org","sentAt":"2005-04-21T07:32:16Z","receivedAt":"2005-04-21T07:32:16Z","isPatch":true,"sender":{"key":"dwmw2@infradead.org","avatar":"https://gravatar.com/avatar/7afd4f07e0cf7d7e046ae2d23678296b37777c96488e6f3451e78a5514154ebd?d=mp&s=160"},"body":"Entirely untested.\n\nMakefile: eca3a5d5256cca06d86ebb85ec9d3218752ffcd2\napplypatch: 397e4a0e506f1c5765767057dfe506154b743b83\n--- a/applypatch\n+++ b/applypatch\n@@ -26,6 +26,7 @@ EDIT=${EDIT:-vi}\n \n export AUTHOR_NAME=\"$(sed -n '/^Author/ s/Author: //p' .dotest/info)\"\n export AUTHOR_EMAIL=\"$(sed -n '/^Email/ s/Email: //p' .dotest/info)\"\n+export AUTHOR_DATE=\"$(sed -n '/^Date/ s/Date: //p' .dotest/info)\"\n export SUBJECT=\"$(sed -n '/^Subject/ s/Subject: //p' .dotest/info)\"\n \n if [ -n \"$signoff\" -a -f \"$signoff\" ]; then\ndotest: a3e3d35ae0afa358f01b49eecb358d64c616c3e4\nmailinfo.c: c1dcac130530174ec5335d2c752d76403ad1d3ad\n--- a/mailinfo.c\n+++ b/mailinfo.c\n@@ -13,6 +13,7 @@ static char line[1000];\n static char name[1000];\n static char email[1000];\n static char subject[1000];\n+static char date[1000];\n \n static char *sanity_check(char *name, char *email)\n {\n@@ -83,6 +84,11 @@ static void handle_subject(char *line)\n \tstrcpy(subject, line);\n }\n \n+static void handle_date(char *line)\n+{\n+\tstrcpy(date, line);\n+}\n+\n static void add_subject_line(char *line)\n {\n \twhile (isspace(*line))\n@@ -99,6 +105,11 @@ static void check_line(char *line, int l\n \t\tcont = 0;\n \t\treturn;\n \t}\n+\tif (!memcmp(line, \"Date:\", 5) && isspace(line[5])) {\n+\t\thandle_date(line+6);\n+\t\tcont = 0;\n+\t\treturn;\n+\t}\n \tif (!memcmp(line, \"Subject:\", 8) && isspace(line[8])) {\n \t\thandle_subject(line+9);\n \t\tcont = 1;\n@@ -107,7 +118,7 @@ static void check_line(char *line, int l\n \tif (isspace(*line)) {\n \t\tswitch (cont) {\n \t\tcase 0:\n-\t\t\tfprintf(stderr, \"I don't do 'From:' line continuations\\n\");\n+\t\t\tfprintf(stderr, \"I don't do 'From:' or 'Date:' header continuations\\n\");\n \t\t\tbreak;\n \t\tcase 1:\n \t\t\tadd_subject_line(line);\n@@ -215,7 +226,8 @@ static void handle_rest(void)\n \tcleanup_space(name);\n \tcleanup_space(email);\n \tcleanup_space(sub);\n-\tprintf(\"Author: %s\\nEmail: %s\\nSubject: %s\\n\\n\", name, email, sub);\n+\tcleanup_space(date);\n+\tprintf(\"Author: %s\\nEmail: %s\\nSubject: %s\\nDate: %s\\n\", name, email, sub, date);\n \tFILE *out = cmitmsg;\n \n \tdo {\nmailsplit.c: 9379fbc5e84983e5ea0754a6587cc3490c696c69\n\n-- \ndwmw2\n\n"},{"id":"1771","messageId":"20050426184442.GA20536@kroah.com","threadId":"192","inReplyTo":"1114068737.29135.17.camel@localhost.localdomain","subject":"Re: [PATCH] Set AUTHOR_DATE in git-tools","fromName":"Greg KH","fromEmail":"greg@kroah.com","sentAt":"2005-04-26T18:44:42Z","receivedAt":"2005-04-26T18:44:42Z","isPatch":true,"sender":{"key":"greg@kroah.com","avatar":"https://gravatar.com/avatar/5bb5aa0cc2e01c00ec899d11130c07796bc186e465bae57bc34873b13b72c7c8?d=mp&s=160"},"body":"On Thu, Apr 21, 2005 at 05:32:16PM +1000, David Woodhouse wrote:\n> Entirely untested.\n\nDoesn't work :(\n\nAnd I couldn't see a simple reason why, oh well.\n\ngreg k-h\n"},{"id":"1844","messageId":"20050427035206.GA27615@kroah.com","threadId":"192","inReplyTo":"20050426184442.GA20536@kroah.com","subject":"Re: [PATCH] Set AUTHOR_DATE in git-tools","fromName":"Greg KH","fromEmail":"greg@kroah.com","sentAt":"2005-04-27T03:52:06Z","receivedAt":"2005-04-27T03:52:06Z","isPatch":true,"sender":{"key":"greg@kroah.com","avatar":"https://gravatar.com/avatar/5bb5aa0cc2e01c00ec899d11130c07796bc186e465bae57bc34873b13b72c7c8?d=mp&s=160"},"body":"On Tue, Apr 26, 2005 at 11:44:42AM -0700, Greg KH wrote:\n> On Thu, Apr 21, 2005 at 05:32:16PM +1000, David Woodhouse wrote:\n> > Entirely untested.\n> \n> Doesn't work :(\n\nI take it back, it works just fine... \n\nMy problem was that bk generates dates with a non-rfc compliant timezone\nstring.  And I was trying to apply patches exported from bk in plain\ntext format (building a udev git tree...)  The patch below to\ncommit-tree.c fixes this issue, if anyone runs into this same issue (I\nwouldn't recommend it to be applied, as it's probably a one-off\nissue...)\n\nthanks,\n\ngreg k-h\n--------------\nAllow commit-tree to handle the bk date format.\n\nSigned-off-by: Greg Kroah-Hartman <gregkh@suse.de>\n\n\n--- a/commit-tree.c\t2005-04-25 22:08:49.000000000 -0700\n+++ b/commit-tree.c\t2005-04-26 20:46:37.000000000 -0700\n@@ -204,6 +204,12 @@\n \telse\n \t       return;\n \n+\t/* Handle messed up bk dates */\n+\tif (p[3] == ':') {\n+\t\tp[3] = p[4];\n+\t\tp[4] = p[5];\n+\t\tp[5] = p[6];\n+\t}\n \tif (!isdigit(p[1]) || !isdigit(p[2]) || !isdigit(p[3]) || !isdigit(p[4]))\n \t\treturn;\n \n"}]}