{"thread":{"id":"28089","subject":"git am ~/Documents/mail-[1-9]-11.txt Patch format detection failed.","startedAt":"2011-08-13T19:49:35Z","lastAt":"2011-08-14T08:20:47Z","messageCount":4,"participants":["Jim Cromie","David Aguilar","Ramkumar Ramachandra"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"173461","messageId":"CAJfuBxx9Ayo8cHga+vK+Ynx5P7dhST7f=p87-qyjEzofSdZ=RQ@mail.gmail.com","threadId":"28089","inReplyTo":null,"subject":"git am ~/Documents/mail-[1-9]-11.txt Patch format detection failed.","fromName":"Jim Cromie","fromEmail":"jim.cromie@gmail.com","sentAt":"2011-08-13T19:49:35Z","receivedAt":"2011-08-13T19:49:35Z","isPatch":false,"sender":{"key":"jim.cromie@gmail.com","avatar":null},"body":"git am is giving me trouble.\n\nIm a gmail user, and have saved a patch series by doing\nshow-original, save w rename for each patch\n\ngit apply mail-1-11.txt works,\nbut it disregards the commit-msg, so commit-ids are lost,\n(I could attempt to checkin each with cut-paste commit-msgs,\nbut this sounds like a losing game)\nand patchset isnt trackable as such.\n\ngrabbing diffs from lkml.org site doesnt help,\nsince theyre raw diffs, theyre lacking the commit-msg.\n\nhave I missed an option, or is am's format detection less than it should be ?\n\nIve attached mail-1-11, which applies cleanly to v3.0, but wont am.\n\n\n                                                                                                                                                                                                                                                               \nDelivered-To: jim.cromie@gmail.com\nReceived: by 10.142.178.18 with SMTP id a18cs193734wff;\n        Thu, 11 Aug 2011 11:36:25 -0700 (PDT)\nReceived: from mr.google.com ([10.151.86.15])\n        by 10.151.86.15 with SMTP id o15mr1391877ybl.13.1313087785695 (num_hops = 1);\n        Thu, 11 Aug 2011 11:36:25 -0700 (PDT)\nReceived: by 10.151.86.15 with SMTP id o15mr1000356ybl.13.1313087784175;\n        Thu, 11 Aug 2011 11:36:24 -0700 (PDT)\nReturn-Path: <jbaron@redhat.com>\nReceived: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n        by mx.google.com with ESMTP id b12si2813718ybi.101.2011.08.11.11.36.23;\n        Thu, 11 Aug 2011 11:36:24 -0700 (PDT)\nReceived-SPF: pass (google.com: domain of jbaron@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28;\nAuthentication-Results: mx.google.com; spf=pass (google.com: domain of jbaron@redhat.com designates 209.132.183.28 as permitted sender) smtp.mail=jbaron@redhat.com\nReceived: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\tby mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7BIaLoG008295\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);\n\tThu, 11 Aug 2011 14:36:21 -0400\nReceived: from redhat.com (dhcp-100-19-188.bos.redhat.com [10.16.19.188])\n\tby int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7BIaLal007962;\n\tThu, 11 Aug 2011 14:36:21 -0400\nDate: Thu, 11 Aug 2011 14:36:21 -0400\nFrom: Jason Baron <jbaron@redhat.com>\nTo: gregkh@suse.de\nCc: joe@perches.com, jim.cromie@gmail.com, bvanassche@acm.org,\n        linux-kernel@vger.kernel.org, davem@davemloft.net,\n        aloisio.almeida@openbossa.org, netdev@vger.kernel.org\nMessage-Id: <b5c13500eac4e5dfa0ee960c6f186eeb1b4585b4.1313085588.git.jbaron@redhat.com>\nIn-Reply-To: <cover.1313085588.git.jbaron@redhat.com>\nReferences: <cover.1313085588.git.jbaron@redhat.com>\nSubject: [PATCH 01/11] dynamic_debug: Add __dynamic_dev_dbg\nX-Scanned-By: MIMEDefang 2.67 on 10.5.11.12\n\nFrom: Joe Perches <joe@perches.com>\n\nUnlike dynamic_pr_debug, dynamic uses of dev_dbg can not\ncurrently add task_pid/KBUILD_MODNAME/__func__/__LINE__\nto selected debug output.\n\nAdd a new function similar to dynamic_pr_debug to\noptionally emit these prefixes.\n\nCc: Aloisio Almeida <aloisio.almeida@openbossa.org>\nNoticed-by: Aloisio Almeida <aloisio.almeida@openbossa.org>\nSigned-off-by: Joe Perches <joe@perches.com>\nSigned-off-by: Jason Baron <jbaron@redhat.com>\n---\n drivers/base/core.c           |    5 +++--\n include/linux/device.h        |    5 +++++\n include/linux/dynamic_debug.h |   10 ++++++++--\n lib/dynamic_debug.c           |   38 ++++++++++++++++++++++++++++++++++++++\n 4 files changed, 54 insertions(+), 4 deletions(-)\n\ndiff --git a/drivers/base/core.c b/drivers/base/core.c\nindex bc8729d..82c8654 100644\n--- a/drivers/base/core.c\n+++ b/drivers/base/core.c\n@@ -1764,8 +1764,8 @@ void device_shutdown(void)\n \n #ifdef CONFIG_PRINTK\n \n-static int __dev_printk(const char *level, const struct device *dev,\n-\t\t\tstruct va_format *vaf)\n+int __dev_printk(const char *level, const struct device *dev,\n+\t\t struct va_format *vaf)\n {\n \tif (!dev)\n \t\treturn printk(\"%s(NULL device *): %pV\", level, vaf);\n@@ -1773,6 +1773,7 @@ static int __dev_printk(const char *level, const struct device *dev,\n \treturn printk(\"%s%s %s: %pV\",\n \t\t      level, dev_driver_string(dev), dev_name(dev), vaf);\n }\n+EXPORT_SYMBOL(__dev_printk);\n \n int dev_printk(const char *level, const struct device *dev,\n \t       const char *fmt, ...)\ndiff --git a/include/linux/device.h b/include/linux/device.h\nindex c20dfbf..4639419 100644\n--- a/include/linux/device.h\n+++ b/include/linux/device.h\n@@ -785,6 +785,8 @@ extern const char *dev_driver_string(const struct device *dev);\n \n #ifdef CONFIG_PRINTK\n \n+extern int __dev_printk(const char *level, const struct device *dev,\n+\t\t\tstruct va_format *vaf);\n extern int dev_printk(const char *level, const struct device *dev,\n \t\t      const char *fmt, ...)\n \t__attribute__ ((format (printf, 3, 4)));\n@@ -805,6 +807,9 @@ extern int _dev_info(const struct device *dev, const char *fmt, ...)\n \n #else\n \n+static inline int __dev_printk(const char *level, const struct device *dev,\n+\t\t\t       struct va_format *vaf)\n+\t { return 0; }\n static inline int dev_printk(const char *level, const struct device *dev,\n \t\t      const char *fmt, ...)\n \t__attribute__ ((format (printf, 3, 4)));\ndiff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h\nindex e747ecd..bdf1531 100644\n--- a/include/linux/dynamic_debug.h\n+++ b/include/linux/dynamic_debug.h\n@@ -47,6 +47,13 @@ extern int ddebug_remove_module(const char *mod_name);\n extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)\n \t__attribute__ ((format (printf, 2, 3)));\n \n+struct device;\n+\n+extern int __dynamic_dev_dbg(struct _ddebug *descriptor,\n+\t\t\t     const struct device *dev,\n+\t\t\t     const char *fmt, ...)\n+\t__attribute__ ((format (printf, 3, 4)));\n+\n #define dynamic_pr_debug(fmt, ...) do {\t\t\t\t\t\\\n \tstatic struct _ddebug descriptor\t\t\t\t\\\n \t__used\t\t\t\t\t\t\t\t\\\n@@ -57,7 +64,6 @@ extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)\n \t\t__dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \\\n \t} while (0)\n \n-\n #define dynamic_dev_dbg(dev, fmt, ...) do {\t\t\t\t\\\n \tstatic struct _ddebug descriptor\t\t\t\t\\\n \t__used\t\t\t\t\t\t\t\t\\\n@@ -65,7 +71,7 @@ extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)\n \t{ KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__,\t\t\\\n \t\t_DPRINTK_FLAGS_DEFAULT };\t\t\t\t\\\n \tif (unlikely(descriptor.enabled))\t\t\t\t\\\n-\t\tdev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__);\t\\\n+\t\t__dynamic_dev_dbg(&descriptor, dev, fmt, ##__VA_ARGS__);\t\\\n \t} while (0)\n \n #else\ndiff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c\nindex 75ca78f..63b6f95 100644\n--- a/lib/dynamic_debug.c\n+++ b/lib/dynamic_debug.c\n@@ -30,6 +30,7 @@\n #include <linux/jump_label.h>\n #include <linux/hardirq.h>\n #include <linux/sched.h>\n+#include <linux/device.h>\n \n extern struct _ddebug __start___verbose[];\n extern struct _ddebug __stop___verbose[];\n@@ -456,6 +457,43 @@ int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)\n }\n EXPORT_SYMBOL(__dynamic_pr_debug);\n \n+int __dynamic_dev_dbg(struct _ddebug *descriptor,\n+\t\t      const struct device *dev, const char *fmt, ...)\n+{\n+\tstruct va_format vaf;\n+\tva_list args;\n+\tint res;\n+\n+\tBUG_ON(!descriptor);\n+\tBUG_ON(!fmt);\n+\n+\tva_start(args, fmt);\n+\n+\tvaf.fmt = fmt;\n+\tvaf.va = &args;\n+\n+\tres = printk(KERN_DEBUG);\n+\tif (descriptor->flags & _DPRINTK_FLAGS_INCL_TID) {\n+\t\tif (in_interrupt())\n+\t\t\tres += printk(KERN_CONT \"<intr> \");\n+\t\telse\n+\t\t\tres += printk(KERN_CONT \"[%d] \", task_pid_vnr(current));\n+\t}\n+\tif (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME)\n+\t\tres += printk(KERN_CONT \"%s:\", descriptor->modname);\n+\tif (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME)\n+\t\tres += printk(KERN_CONT \"%s:\", descriptor->function);\n+\tif (descriptor->flags & _DPRINTK_FLAGS_INCL_LINENO)\n+\t\tres += printk(KERN_CONT \"%d \", descriptor->lineno);\n+\n+\tres += __dev_printk(KERN_CONT, dev, &vaf);\n+\n+\tva_end(args);\n+\n+\treturn res;\n+}\n+EXPORT_SYMBOL(__dynamic_dev_dbg);\n+\n static __initdata char ddebug_setup_string[1024];\n static __init int ddebug_setup_query(char *str)\n {\n-- \n1.7.5.4\n\n"},{"id":"173471","messageId":"20110814021414.GA8724@gmail.com","threadId":"28089","inReplyTo":"CAJfuBxx9Ayo8cHga+vK+Ynx5P7dhST7f=p87-qyjEzofSdZ=RQ@mail.gmail.com","subject":"Re: git am ~/Documents/mail-[1-9]-11.txt Patch format detection failed.","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2011-08-14T02:14:16Z","receivedAt":"2011-08-14T02:14:16Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Sat, Aug 13, 2011 at 01:49:35PM -0600, Jim Cromie wrote:\n> git am is giving me trouble.\n> \n> Im a gmail user, and have saved a patch series by doing\n> show-original, save w rename for each patch\n> [snip]\n\nMy experience with gmail + patches is that you need to use an\nemail client to download patches, not the web interface.\n\nmutt works well for me.  Any client that can talk to gmail\nover imaps:// should do the trick.\n\nI couldn't find what was wrong with the patch you\nattached to your original message, though.\n-- \n\t\t\t\t\tDavid\n"},{"id":"173472","messageId":"CALkWK0kmZLiSzSwZ9YqjZMpx3SzZ5gDC4Y6CFtSu3x2EcvE-rQ@mail.gmail.com","threadId":"28089","inReplyTo":"CAJfuBxx9Ayo8cHga+vK+Ynx5P7dhST7f=p87-qyjEzofSdZ=RQ@mail.gmail.com","subject":"Re: git am ~/Documents/mail-[1-9]-11.txt Patch format detection failed.","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2011-08-14T03:06:51Z","receivedAt":"2011-08-14T03:06:51Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi Jim,\n\n[+CC: David Barr]\n\nJim Cromie writes:\n> git am is giving me trouble.\n>\n> Im a gmail user, and have saved a patch series by doing\n> show-original, save w rename for each patch\n> [...]\n> Ive attached mail-1-11, which applies cleanly to v3.0, but wont am.\n\nIt works quite well for me after David's recent patch: 0e8341f2 (am:\nignore leading whitespace before patch, 2011-08-08).  The patch has\nalready made it to 'next', but hasn't hit 'master' yet.  Could you\nplease try it and tell us if there are any issues?\n\nThanks.\n\n-- Ram\n"},{"id":"173473","messageId":"CAJfuBxx9Vh2rWsUA--qVrwa7Gfzboo-=D8auxXquZ8NaxqsQTg@mail.gmail.com","threadId":"28089","inReplyTo":"CALkWK0kmZLiSzSwZ9YqjZMpx3SzZ5gDC4Y6CFtSu3x2EcvE-rQ@mail.gmail.com","subject":"Re: git am ~/Documents/mail-[1-9]-11.txt Patch format detection failed.","fromName":"Jim Cromie","fromEmail":"jim.cromie@gmail.com","sentAt":"2011-08-14T08:20:47Z","receivedAt":"2011-08-14T08:20:47Z","isPatch":false,"sender":{"key":"jim.cromie@gmail.com","avatar":null},"body":"On Sat, Aug 13, 2011 at 9:06 PM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Hi Jim,\n>\n> [+CC: David Barr]\n>\n> Jim Cromie writes:\n>> git am is giving me trouble.\n>>\n>> Im a gmail user, and have saved a patch series by doing\n>> show-original, save w rename for each patch\n>> [...]\n>> Ive attached mail-1-11, which applies cleanly to v3.0, but wont am.\n>\n> It works quite well for me after David's recent patch: 0e8341f2 (am:\n> ignore leading whitespace before patch, 2011-08-08).  The patch has\n> already made it to 'next', but hasn't hit 'master' yet.  Could you\n> please try it and tell us if there are any issues?\n>\n> Thanks.\n>\n> -- Ram\n>\n\nthanks Ram,\n\nI just pulled and built next branch, it worked for me.\n\n[jimc@groucho linux-2.6]$ ../../git/git am ~/Documents/mail-[1-9]-11.txt\nApplying: dynamic_debug: Add __dynamic_dev_dbg\nApplying: dynamic_debug: Consolidate prefix output to single routine\nApplying: dynamic_debug: Remove uses of KERN_CONT in dynamic_emit_prefix\nApplying: dynamic_debug: Convert printks to pr_<level>\nApplying: dynamic_debug: remove unused control variables\n...\n\nthanks\n"}]}