{"thread":{"id":"37550","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","startedAt":"2014-09-13T09:37:46Z","lastAt":"2014-09-16T20:29:03Z","messageCount":22,"participants":["Dan Carpenter","Greg KH","Jeff King","Mark Einon","brian m. carlson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"249341","messageId":"20140913093746.GD6600@mwanda","threadId":"37550","inReplyTo":"1410472786-14552-5-git-send-email-mark.einon@gmail.com","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","fromName":"Dan Carpenter","fromEmail":"dan.carpenter@oracle.com","sentAt":"2014-09-13T09:37:46Z","receivedAt":"2014-09-13T09:37:46Z","isPatch":true,"sender":{"key":"dan.carpenter@oracle.com","avatar":null},"body":"On Thu, Sep 11, 2014 at 10:59:42PM +0100, Mark Einon wrote:\n> >From struct ce_stats; unicast_pkts_rcvd, unicast_pkts_xmtd,\n> multicast_pkts_xmtd, broadcast_pkts_rcvd and broadcast_pkts_xmtd\n\nFor some reason something adds a '>' to the start of lines which start\nwith 'From'.  I don't know what it is...\n\nWhen I apply this patch with 'git am' then it just removes the From\nline.\n\nI have seen these '>From' lines before but I haven't seen anyone discuss\nthis problem.\n\nregards,\ndan carpenter\n"},{"id":"249350","messageId":"20140913154556.GA12361@kroah.com","threadId":"37550","inReplyTo":"20140913093746.GD6600@mwanda","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","fromName":"Greg KH","fromEmail":"gregkh@linuxfoundation.org","sentAt":"2014-09-13T15:45:56Z","receivedAt":"2014-09-13T15:45:56Z","isPatch":true,"sender":{"key":"gregkh@linuxfoundation.org","avatar":"https://gravatar.com/avatar/e6d9136f6e3bdcb59f0e5fd15565f382da42523d273824958b9e23e73cf38e04?d=mp&s=160"},"body":"On Sat, Sep 13, 2014 at 12:37:46PM +0300, Dan Carpenter wrote:\n> On Thu, Sep 11, 2014 at 10:59:42PM +0100, Mark Einon wrote:\n> > >From struct ce_stats; unicast_pkts_rcvd, unicast_pkts_xmtd,\n> > multicast_pkts_xmtd, broadcast_pkts_rcvd and broadcast_pkts_xmtd\n> \n> For some reason something adds a '>' to the start of lines which start\n> with 'From'.  I don't know what it is...\n\nIt's an email protocol requirement, some RFC dictates it as \"From\" at\nthe start of the line is an email \"start\" flag.\n\n> When I apply this patch with 'git am' then it just removes the From\n> line.\n\nAs it should :)\n\nthanks,\n\ngreg k-h\n"},{"id":"249353","messageId":"20140913194134.GF6549@mwanda","threadId":"37550","inReplyTo":"20140913154556.GA12361@kroah.com","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","fromName":"Dan Carpenter","fromEmail":"dan.carpenter@oracle.com","sentAt":"2014-09-13T19:41:34Z","receivedAt":"2014-09-13T19:41:34Z","isPatch":true,"sender":{"key":"dan.carpenter@oracle.com","avatar":null},"body":"On Sat, Sep 13, 2014 at 08:45:56AM -0700, Greg KH wrote:\n> On Sat, Sep 13, 2014 at 12:37:46PM +0300, Dan Carpenter wrote:\n> > On Thu, Sep 11, 2014 at 10:59:42PM +0100, Mark Einon wrote:\n> > > >From struct ce_stats; unicast_pkts_rcvd, unicast_pkts_xmtd,\n> > > multicast_pkts_xmtd, broadcast_pkts_rcvd and broadcast_pkts_xmtd\n> > \n> > For some reason something adds a '>' to the start of lines which start\n> > with 'From'.  I don't know what it is...\n> \n> It's an email protocol requirement, some RFC dictates it as \"From\" at\n> the start of the line is an email \"start\" flag.\n> \n> > When I apply this patch with 'git am' then it just removes the From\n> > line.\n> \n> As it should :)\n> \n\nBut now the changelog is corrupt.  I have tested with the git version\n2.1.0.238.gce1d3a9.  The first line of the changelog gets chopped off\nbecause of the \">From\".\n\nIt's a little annoying.  Do we just tell Mark to resend with a different\nchangelog or is there a way to fix the tools?\n\nregards,\ndan carpenter\n"},{"id":"249358","messageId":"20140913203645.GB24854@peff.net","threadId":"37550","inReplyTo":"20140913154556.GA12361@kroah.com","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-13T20:36:45Z","receivedAt":"2014-09-13T20:36:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Sep 13, 2014 at 08:45:56AM -0700, Greg KH wrote:\n\n> On Sat, Sep 13, 2014 at 12:37:46PM +0300, Dan Carpenter wrote:\n> > On Thu, Sep 11, 2014 at 10:59:42PM +0100, Mark Einon wrote:\n> > > >From struct ce_stats; unicast_pkts_rcvd, unicast_pkts_xmtd,\n> > > multicast_pkts_xmtd, broadcast_pkts_rcvd and broadcast_pkts_xmtd\n> > \n> > For some reason something adds a '>' to the start of lines which start\n> > with 'From'.  I don't know what it is...\n> \n> It's an email protocol requirement, some RFC dictates it as \"From\" at\n> the start of the line is an email \"start\" flag.\n\nIt's not an RFC thing. It's a side effect of the mbox format, which\nsquashes together multiple messages with \"From \" lines to mark their\nstarts. So many mbox implementations will quote them as \">From\" (others\nintroduce a Content-Length header, or are simply more careful about\nmaking sure that the line looks like a real \"From \" line, which should\ncontain a date).\n\nIf somebody's MUA is actually transmitting emails with the quoting,\nthat's wrong. It is a local storage problem, and they should not be\nspreading the quoting disease to other systems.\n\n> > When I apply this patch with 'git am' then it just removes the From\n> > line.\n> \n> As it should :)\n\nThat seems wrong. We should either leave it as-is (i.e., assume the\nwriter used no quoting and really did mean \">From\") or strip the \">\" to\nturn it into \"From\" (i.e., assume the writer did use quoting). In some\nimplementations, a literal \">From\" gets quoted to \">>From\" and so on. So\nwe could even strip one level of quoting from such things (if we assume\nthe writer was such an implementation).\n\nI don't think we can make this 100% foolproof without knowing which mbox\nvariant the writer used. But dropping the line is probably the worst\npossible thing, as it does not match _any_ variants. :)\n\n-Peff\n"},{"id":"249359","messageId":"20140913204745.GA12291@msilap.einon.net","threadId":"37550","inReplyTo":"20140913203645.GB24854@peff.net","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","fromName":"Mark Einon","fromEmail":"mark.einon@gmail.com","sentAt":"2014-09-13T20:47:45Z","receivedAt":"2014-09-13T20:47:45Z","isPatch":true,"sender":{"key":"mark.einon@gmail.com","avatar":null},"body":"On Sat, Sep 13, 2014 at 04:36:45PM -0400, Jeff King wrote:\n> I don't think we can make this 100% foolproof without knowing which mbox\n> variant the writer used. But dropping the line is probably the worst\n> possible thing, as it does not match _any_ variants. :)\n\nHi,\n\nFYI it was 'git send-email' v2.1.0 that sent the mail, and I don't have\nthe offending character in any versions of the mail I can see.\n\nCheers,\n\nMark\n"},{"id":"249360","messageId":"20140913205751.GA17875@mwanda","threadId":"37550","inReplyTo":"20140913204745.GA12291@msilap.einon.net","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","fromName":"Dan Carpenter","fromEmail":"dan.carpenter@oracle.com","sentAt":"2014-09-13T20:57:51Z","receivedAt":"2014-09-13T20:57:51Z","isPatch":true,"sender":{"key":"dan.carpenter@oracle.com","avatar":null},"body":"On Sat, Sep 13, 2014 at 09:47:45PM +0100, Mark Einon wrote:\n> On Sat, Sep 13, 2014 at 04:36:45PM -0400, Jeff King wrote:\n> > I don't think we can make this 100% foolproof without knowing which mbox\n> > variant the writer used. But dropping the line is probably the worst\n> > possible thing, as it does not match _any_ variants. :)\n> \n> Hi,\n> \n> FYI it was 'git send-email' v2.1.0 that sent the mail, and I don't have\n> the offending character in any versions of the mail I can see.\n> \n\nThe mailing list version has it.\n\nhttp://www.spinics.net/lists/linux-driver-devel/msg54372.html\n\nregards,\ndan carpenter\n"},{"id":"249361","messageId":"20140913210652.GB12291@msilap.einon.net","threadId":"37550","inReplyTo":"20140913205751.GA17875@mwanda","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","fromName":"Mark Einon","fromEmail":"mark.einon@gmail.com","sentAt":"2014-09-13T21:06:52Z","receivedAt":"2014-09-13T21:06:52Z","isPatch":true,"sender":{"key":"mark.einon@gmail.com","avatar":null},"body":"On Sat, Sep 13, 2014 at 11:57:51PM +0300, Dan Carpenter wrote:\n> On Sat, Sep 13, 2014 at 09:47:45PM +0100, Mark Einon wrote:\n> > On Sat, Sep 13, 2014 at 04:36:45PM -0400, Jeff King wrote:\n> > > I don't think we can make this 100% foolproof without knowing which mbox\n> > > variant the writer used. But dropping the line is probably the worst\n> > > possible thing, as it does not match _any_ variants. :)\n> > \n> > Hi,\n> > \n> > FYI it was 'git send-email' v2.1.0 that sent the mail, and I don't have\n> > the offending character in any versions of the mail I can see.\n> > \n> \n> The mailing list version has it.\n> \n> http://www.spinics.net/lists/linux-driver-devel/msg54372.html\n\nFair enough. The marc.info version doesn't though, so it's proably not my MUA:\n\nhttp://marc.info/?l=linux-driver-devel&m=141047281318963&w=2\n\nCheers,\n\nMark\n"},{"id":"249362","messageId":"20140913210908.GG6549@mwanda","threadId":"37550","inReplyTo":"20140913205751.GA17875@mwanda","subject":"Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics","fromName":"Dan Carpenter","fromEmail":"dan.carpenter@oracle.com","sentAt":"2014-09-13T21:09:08Z","receivedAt":"2014-09-13T21:09:08Z","isPatch":true,"sender":{"key":"dan.carpenter@oracle.com","avatar":null},"body":"On Sat, Sep 13, 2014 at 11:57:51PM +0300, Dan Carpenter wrote:\n> On Sat, Sep 13, 2014 at 09:47:45PM +0100, Mark Einon wrote:\n> > On Sat, Sep 13, 2014 at 04:36:45PM -0400, Jeff King wrote:\n> > > I don't think we can make this 100% foolproof without knowing which mbox\n> > > variant the writer used. But dropping the line is probably the worst\n> > > possible thing, as it does not match _any_ variants. :)\n> > \n> > Hi,\n> > \n> > FYI it was 'git send-email' v2.1.0 that sent the mail, and I don't have\n> > the offending character in any versions of the mail I can see.\n> > \n> \n> The mailing list version has it.\n> \n> http://www.spinics.net/lists/linux-driver-devel/msg54372.html\n\nOr based on Peff's email it might be a bug in the spinics list software.\nHere are some other examples:\n\nPiper mail has '>From'.\nhttp://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2014-September/058299.html\n\nbut gmane gets it right.\nhttp://comments.gmane.org/gmane.linux.drivers.driver-project.devel/57684\n\nregards,\ndan carpenter\n"},{"id":"249363","messageId":"20140913212504.GA25190@peff.net","threadId":"37550","inReplyTo":"20140913210908.GG6549@mwanda","subject":"[RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-13T21:25:05Z","receivedAt":"2014-09-13T21:25:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"[-cc driver-devel list, as this is getting into git patches]\n\nOn Sun, Sep 14, 2014 at 12:09:08AM +0300, Dan Carpenter wrote:\n\n> > > FYI it was 'git send-email' v2.1.0 that sent the mail, and I don't have\n> > > the offending character in any versions of the mail I can see.\n> [...]\n> Piper mail has '>From'.\n> http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2014-September/058299.html\n> \n> but gmane gets it right.\n> http://comments.gmane.org/gmane.linux.drivers.driver-project.devel/57684\n\nThanks both of you for following up. I did confirm that git-send-email\ndoes not add such quoting. From your findings above, I'd agree that it's\nthe list-archive software munging it, and they are buggy IMHO (they\nshould de-quote on display).\n\nHere's an RFC patch to help the \"git am\" side handle this case better.\n\n-- >8 --\nSubject: mailinfo: do not treat \">From\" lines as in-body headers\n\nSince commit 81c5cf7 (mailinfo: skip bogus UNIX From line\ninside body, 2006-05-21), we have treated lines like \">From\"\nin the body as headers. This makes \"git am\" work for people\nwho erroneously paste the whole mbox entry:\n\n  From 12345abcd...\n  From: them\n  Subject: [PATCH] whatever\n\ninto their email body. However, it also causes false\npositives for people who really do have \">From\" in the first\nparagraph of their commit messages. In this case, we'll drop\nthe line completely, breaking the commit message.\n\nWe could try to make our checking more robust by doing one\nor both of:\n\n  - making sure the line looks like a git \"From \" line\n    (40-hex sha1, date, etc).\n\n  - seeing if the following lines are actually rfc2822\n    headers\n\nHowever, it's probably not worth the complexity. There are a\nfew reasons to think that this code is not actually\ntriggered very often. One, the patch was written in 2006,\nwhen git was still relatively new, and people frequently\nmade mistakes in sending patches; these days we not see this\nerror much. And two, we check only the quoted \">From\" form,\nand not the regular \"From\". So whether it kicks in at all\ndepends entirely on how the mbox is saved by the user's MUA.\nAnd in the intervening 8 years, nobody has complained about\nthe \"From\" case.\n\nWith this patch, we will simply treat such \">From\" lines as\nnormal body lines (and stop in-body header parsing). Note\nthat we do _not_ unquote them into \"From\". Whether\nfrom-quoting is in effect depends on the exact mbox format\nbeing used, which depends on the MUA writing the file. We\ncannot know for sure whether to unquote or not, so we leave\nthe line alone.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI admit my arguments that it is not in use are a little flaky, and this\nmay just be me being lazy. Trying to match arbitrary \"From\" lines is\nvery hard and heuristic-filled, but if we are only trying to match\ngit-generated mbox lines, that's much easier. It would not hurt too much\nto go that route.\n\nI also tend to think we should unquote \">From\" into \"From\". As discussed\nabove, we do know whether the author meant the literal former, or meant\nthe latter and it quoted into the former. But I'd guess that a literal\n\">From\" is quite rare, so we'd probably serve more people by de-quoting.\nThat is really a separate issue for another patch, though.\n\n builtin/mailinfo.c         |  4 ----\n t/t5100-mailinfo.sh        |  9 +++++++++\n t/t5100/quoted-from.expect |  3 +++\n t/t5100/quoted-from.in     | 10 ++++++++++\n 4 files changed, 22 insertions(+), 4 deletions(-)\n create mode 100644 t/t5100/quoted-from.expect\n create mode 100644 t/t5100/quoted-from.in\n\ndiff --git a/builtin/mailinfo.c b/builtin/mailinfo.c\nindex cf11c8d..0a08e44 100644\n--- a/builtin/mailinfo.c\n+++ b/builtin/mailinfo.c\n@@ -328,10 +328,6 @@ static int check_header(const struct strbuf *line,\n \t}\n \n \t/* for inbody stuff */\n-\tif (starts_with(line->buf, \">From\") && isspace(line->buf[5])) {\n-\t\tret = 1; /* Should this return 0? */\n-\t\tgoto check_header_out;\n-\t}\n \tif (starts_with(line->buf, \"[PATCH]\") && isspace(line->buf[7])) {\n \t\tfor (i = 0; header[i]; i++) {\n \t\t\tif (!strcmp(\"Subject\", header[i])) {\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex 3e64a7a..578ff16 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -89,4 +89,13 @@ test_expect_success 'mailinfo on from header without name works' '\n \n '\n \n+test_expect_success 'mailinfo on message with quoted >From' '\n+\tmkdir quoted-from &&\n+\tgit mailsplit -oquoted-from \"$TEST_DIRECTORY\"/t5100/quoted-from.in &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/quoted-from.in quoted-from/0001 &&\n+\tgit mailinfo quoted-from/msg quoted-from/patch \\\n+\t  <quoted-from/0001 >quoted-from/out &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/quoted-from.expect quoted-from/msg\n+'\n+\n test_done\ndiff --git a/t/t5100/quoted-from.expect b/t/t5100/quoted-from.expect\nnew file mode 100644\nindex 0000000..8c9d48c\n--- /dev/null\n+++ b/t/t5100/quoted-from.expect\n@@ -0,0 +1,3 @@\n+>From the depths of history, we are stuck with the\n+flaky mbox format.\n+\ndiff --git a/t/t5100/quoted-from.in b/t/t5100/quoted-from.in\nnew file mode 100644\nindex 0000000..847e1c4\n--- /dev/null\n+++ b/t/t5100/quoted-from.in\n@@ -0,0 +1,10 @@\n+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n+From: Author Name <somebody@example.com>\n+Date: Sun, 25 May 2008 00:38:18 -0700\n+Subject: [PATCH] testing quoted >From\n+\n+>From the depths of history, we are stuck with the\n+flaky mbox format.\n+\n+---\n+patch\n-- \n2.1.0.373.g91ca799\n"},{"id":"249366","messageId":"20140913225713.GB189120@vauxhall.crustytoothpaste.net","threadId":"37550","inReplyTo":"20140913212504.GA25190@peff.net","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-09-13T22:57:14Z","receivedAt":"2014-09-13T22:57:14Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Sat, Sep 13, 2014 at 05:25:05PM -0400, Jeff King wrote:\n> Thanks both of you for following up. I did confirm that git-send-email\n> does not add such quoting. From your findings above, I'd agree that it's\n> the list-archive software munging it, and they are buggy IMHO (they\n> should de-quote on display).\n\nI wonder if git send-email should do what mutt does in this case, which\nis use quoted-printable encoding and encode the first F as =46 (as well\nas any equals signs as =3D).  It looks like mailinfo.c already is\ncapable of handling that, and that would avoid the entire issue.\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"},{"id":"249367","messageId":"20140914004725.GA28010@peff.net","threadId":"37550","inReplyTo":"20140913225713.GB189120@vauxhall.crustytoothpaste.net","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-14T00:47:26Z","receivedAt":"2014-09-14T00:47:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Sep 13, 2014 at 10:57:14PM +0000, brian m. carlson wrote:\n\n> On Sat, Sep 13, 2014 at 05:25:05PM -0400, Jeff King wrote:\n> > Thanks both of you for following up. I did confirm that git-send-email\n> > does not add such quoting. From your findings above, I'd agree that it's\n> > the list-archive software munging it, and they are buggy IMHO (they\n> > should de-quote on display).\n> \n> I wonder if git send-email should do what mutt does in this case, which\n> is use quoted-printable encoding and encode the first F as =46 (as well\n> as any equals signs as =3D).  It looks like mailinfo.c already is\n> capable of handling that, and that would avoid the entire issue.\n\nThat's not an unreasonable tactic. However, I think we'd still want to\ndo something with mailinfo on the receiving end, similar to the patch I\nsent. We don't know that the sending side is necessarily send-email.\n\n-Peff\n"},{"id":"249368","messageId":"CAPc5daWxZdi+JTTsznefPk2U+Q8uWWYuBUa-rJA4knDZzwU38w@mail.gmail.com","threadId":"37550","inReplyTo":"20140914004725.GA28010@peff.net","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-14T00:55:49Z","receivedAt":"2014-09-14T00:55:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"On Sat, Sep 13, 2014 at 5:47 PM, Jeff King <peff@peff.net> wrote:\n>\n> On Sat, Sep 13, 2014 at 10:57:14PM +0000, brian m. carlson wrote:\n>\n> > I wonder if git send-email should do what mutt does in this case, which\n> > is use quoted-printable encoding and encode the first F as =46 (as well\n> > as any equals signs as =3D).  It looks like mailinfo.c already is\n> > capable of handling that, and that would avoid the entire issue.\n>\n> That's not an unreasonable tactic. However, I think we'd still want to\n> do something with mailinfo on the receiving end, similar to the patch I\n> sent. We don't know that the sending side is necessarily send-email.\n\nHmm, isn't the \">\" stuffing in front of a beginning-of-line \"From \" purely\na local matter of MUA that stores messages in (old-style) mbox format\nwhere a line that begins with \"From \" is what defines the end of the\nprevious message? Why should send-email do anything when it sends\nindividual messages separately out?\n"},{"id":"249371","messageId":"20140914010120.GA28498@peff.net","threadId":"37550","inReplyTo":"CAPc5daWxZdi+JTTsznefPk2U+Q8uWWYuBUa-rJA4knDZzwU38w@mail.gmail.com","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-14T01:01:21Z","receivedAt":"2014-09-14T01:01:21Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Sep 13, 2014 at 05:55:49PM -0700, Junio C Hamano wrote:\n\n> On Sat, Sep 13, 2014 at 5:47 PM, Jeff King <peff@peff.net> wrote:\n> >\n> > On Sat, Sep 13, 2014 at 10:57:14PM +0000, brian m. carlson wrote:\n> >\n> > > I wonder if git send-email should do what mutt does in this case, which\n> > > is use quoted-printable encoding and encode the first F as =46 (as well\n> > > as any equals signs as =3D).  It looks like mailinfo.c already is\n> > > capable of handling that, and that would avoid the entire issue.\n> >\n> > That's not an unreasonable tactic. However, I think we'd still want to\n> > do something with mailinfo on the receiving end, similar to the patch I\n> > sent. We don't know that the sending side is necessarily send-email.\n> \n> Hmm, isn't the \">\" stuffing in front of a beginning-of-line \"From \" purely\n> a local matter of MUA that stores messages in (old-style) mbox format\n> where a line that begins with \"From \" is what defines the end of the\n> previous message?\n\nYes, it is[1].\n\n> Why should send-email do anything when it sends individual messages\n> separately out?\n\nIt does not need to, but the QP-transformation helps protect against\nother, stupider software downstream.  And unlike From-quoting it is\nactually well-specified and reversible.\n\n-Peff\n\n[1] We do use the mbox format in git, and AFAIK do not do any\n    From-quoting of this nature.  I haven't tested, but I suspect that\n    certain format-patch output would be corrupted when reading back via\n    \"git am\", let alone other random mbox readers.  If we wanted to do\n    the QP magic brian suggests, it would probably make sense to do it\n    as part of format-patch.\n"},{"id":"249373","messageId":"20140914013038.GA5974@peff.net","threadId":"37550","inReplyTo":"20140914010120.GA28498@peff.net","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-14T01:30:38Z","receivedAt":"2014-09-14T01:30:38Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Sep 13, 2014 at 09:01:20PM -0400, Jeff King wrote:\n\n> [1] We do use the mbox format in git, and AFAIK do not do any\n>     From-quoting of this nature.  I haven't tested, but I suspect that\n>     certain format-patch output would be corrupted when reading back via\n>     \"git am\", let alone other random mbox readers.  If we wanted to do\n>     the QP magic brian suggests, it would probably make sense to do it\n>     as part of format-patch.\n\nIt looks like we have a reasonably sane is_from_line() function. So at\nleast _we_ will not generally break on reading our own output, except in\nsome extreme circumstances (you'd have to come up with something\ncontrived like \"From me, at 10:30 30 minutes before 11!\").\n\nWe can pretty easily reuse this to make the from-line check in mailinfo\nmore robust. Here's a replacement for the patch I sent earlier that\nkeeps the \"magically ignore extra >From headers\" behavior but fixes the\ncase that started this discussion.\n\nWe could still do the QP thing to protect against other downstream tools\n(or to cover the contrived cases as above), but I think with this patch\nwe at least cover the sane cases.\n\n-- >8 --\nSubject: mailinfo: make \">From\" in-body header check more robust\n\nSince commit 81c5cf7 (mailinfo: skip bogus UNIX From line\ninside body, 2006-05-21), we have treated lines like \">From\"\nin the body as headers. This makes \"git am\" work for people\nwho erroneously paste the whole mbox entry:\n\n  From 12345abcd...\n  From: them\n  Subject: [PATCH] whatever\n\ninto their email body (assuming that an mbox writer then\nquotes \"From\" as \">From\", as otherwise we would actually\nmailsplit on the in-body line).\n\nHowever, this has false positives if somebody actually has a\ncommit body that starts with \"From \"; in this case we\nerroneously remove the line entirely from the commit\nmessage. We can make this check more robust by making sure\nthe line actually looks like a real mbox \"From\" line.\n\nTo do this we pull the \"is_from_line\" definition out of\nmailsplit, and make it available for general use.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Makefile                   |  1 +\n builtin/mailinfo.c         |  2 +-\n builtin/mailsplit.c        | 31 -------------------------------\n cache.h                    |  6 ++++++\n mbox.c                     | 32 ++++++++++++++++++++++++++++++++\n t/t5100-mailinfo.sh        | 18 ++++++++++++++++++\n t/t5100/embed-from.expect  |  5 +++++\n t/t5100/embed-from.in      | 13 +++++++++++++\n t/t5100/quoted-from.expect |  3 +++\n t/t5100/quoted-from.in     | 10 ++++++++++\n 10 files changed, 89 insertions(+), 32 deletions(-)\n create mode 100644 mbox.c\n create mode 100644 t/t5100/embed-from.expect\n create mode 100644 t/t5100/embed-from.in\n create mode 100644 t/t5100/quoted-from.expect\n create mode 100644 t/t5100/quoted-from.in\n\ndiff --git a/Makefile b/Makefile\nindex e0f15a3..e018450 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -704,6 +704,7 @@ LIB_OBJS += lockfile.o\n LIB_OBJS += log-tree.o\n LIB_OBJS += mailmap.o\n LIB_OBJS += match-trees.o\n+LIB_OBJS += mbox.o\n LIB_OBJS += merge.o\n LIB_OBJS += merge-blobs.o\n LIB_OBJS += merge-recursive.o\ndiff --git a/builtin/mailinfo.c b/builtin/mailinfo.c\nindex cf11c8d..a434d39 100644\n--- a/builtin/mailinfo.c\n+++ b/builtin/mailinfo.c\n@@ -329,7 +329,7 @@ static int check_header(const struct strbuf *line,\n \n \t/* for inbody stuff */\n \tif (starts_with(line->buf, \">From\") && isspace(line->buf[5])) {\n-\t\tret = 1; /* Should this return 0? */\n+\t\tret = is_from_line(line->buf + 1, line->len - 1);\n \t\tgoto check_header_out;\n \t}\n \tif (starts_with(line->buf, \"[PATCH]\") && isspace(line->buf[7])) {\ndiff --git a/builtin/mailsplit.c b/builtin/mailsplit.c\nindex 763cda0..11ba281 100644\n--- a/builtin/mailsplit.c\n+++ b/builtin/mailsplit.c\n@@ -12,37 +12,6 @@\n static const char git_mailsplit_usage[] =\n \"git mailsplit [-d<prec>] [-f<n>] [-b] [--keep-cr] -o<directory> [(<mbox>|<Maildir>)...]\";\n \n-static int is_from_line(const char *line, int len)\n-{\n-\tconst char *colon;\n-\n-\tif (len < 20 || memcmp(\"From \", line, 5))\n-\t\treturn 0;\n-\n-\tcolon = line + len - 2;\n-\tline += 5;\n-\tfor (;;) {\n-\t\tif (colon < line)\n-\t\t\treturn 0;\n-\t\tif (*--colon == ':')\n-\t\t\tbreak;\n-\t}\n-\n-\tif (!isdigit(colon[-4]) ||\n-\t    !isdigit(colon[-2]) ||\n-\t    !isdigit(colon[-1]) ||\n-\t    !isdigit(colon[ 1]) ||\n-\t    !isdigit(colon[ 2]))\n-\t\treturn 0;\n-\n-\t/* year */\n-\tif (strtol(colon+3, NULL, 10) <= 90)\n-\t\treturn 0;\n-\n-\t/* Ok, close enough */\n-\treturn 1;\n-}\n-\n static struct strbuf buf = STRBUF_INIT;\n static int keep_cr;\n \ndiff --git a/cache.h b/cache.h\nindex dfa1a56..9e71ca5 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1568,4 +1568,10 @@ void stat_validity_update(struct stat_validity *sv, int fd);\n \n int versioncmp(const char *s1, const char *s2);\n \n+/*\n+ * Returns true if the line appears to be an mbox \"From\" line starting a new\n+ * message.\n+ */\n+int is_from_line(const char *line, int len);\n+\n #endif /* CACHE_H */\ndiff --git a/mbox.c b/mbox.c\nnew file mode 100644\nindex 0000000..75f3150\n--- /dev/null\n+++ b/mbox.c\n@@ -0,0 +1,32 @@\n+#include \"cache.h\"\n+\n+int is_from_line(const char *line, int len)\n+{\n+\tconst char *colon;\n+\n+\tif (len < 20 || memcmp(\"From \", line, 5))\n+\t\treturn 0;\n+\n+\tcolon = line + len - 2;\n+\tline += 5;\n+\tfor (;;) {\n+\t\tif (colon < line)\n+\t\t\treturn 0;\n+\t\tif (*--colon == ':')\n+\t\t\tbreak;\n+\t}\n+\n+\tif (!isdigit(colon[-4]) ||\n+\t    !isdigit(colon[-2]) ||\n+\t    !isdigit(colon[-1]) ||\n+\t    !isdigit(colon[ 1]) ||\n+\t    !isdigit(colon[ 2]))\n+\t\treturn 0;\n+\n+\t/* year */\n+\tif (strtol(colon+3, NULL, 10) <= 90)\n+\t\treturn 0;\n+\n+\t/* Ok, close enough */\n+\treturn 1;\n+}\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex 3e64a7a..9e1ad1c 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -89,4 +89,22 @@ test_expect_success 'mailinfo on from header without name works' '\n \n '\n \n+test_expect_success 'mailinfo finds headers after embedded From line' '\n+\tmkdir embed-from &&\n+\tgit mailsplit -oembed-from \"$TEST_DIRECTORY\"/t5100/embed-from.in &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/embed-from.in embed-from/0001 &&\n+\tgit mailinfo embed-from/msg embed-from/patch \\\n+\t  <embed-from/0001 >embed-from/out &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/embed-from.expect embed-from/out\n+'\n+\n+test_expect_success 'mailinfo on message with quoted >From' '\n+\tmkdir quoted-from &&\n+\tgit mailsplit -oquoted-from \"$TEST_DIRECTORY\"/t5100/quoted-from.in &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/quoted-from.in quoted-from/0001 &&\n+\tgit mailinfo quoted-from/msg quoted-from/patch \\\n+\t  <quoted-from/0001 >quoted-from/out &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/quoted-from.expect quoted-from/msg\n+'\n+\n test_done\ndiff --git a/t/t5100/embed-from.expect b/t/t5100/embed-from.expect\nnew file mode 100644\nindex 0000000..06a3a38\n--- /dev/null\n+++ b/t/t5100/embed-from.expect\n@@ -0,0 +1,5 @@\n+Author: Commit Author\n+Email: commit@example.com\n+Subject: patch subject\n+Date: Sat, 13 Sep 2014 21:13:23 -0400 \n+\ndiff --git a/t/t5100/embed-from.in b/t/t5100/embed-from.in\nnew file mode 100644\nindex 0000000..5f3f84e\n--- /dev/null\n+++ b/t/t5100/embed-from.in\n@@ -0,0 +1,13 @@\n+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n+From: Email Author <email@example.com>\n+Date: Sun, 25 May 2008 00:38:18 -0700\n+Subject: [PATCH] email subject\n+\n+>From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n+From: Commit Author <commit@example.com>\n+Date: Sat, 13 Sep 2014 21:13:23 -0400\n+Subject: patch subject\n+\n+patch body\n+---\n+patch\ndiff --git a/t/t5100/quoted-from.expect b/t/t5100/quoted-from.expect\nnew file mode 100644\nindex 0000000..8c9d48c\n--- /dev/null\n+++ b/t/t5100/quoted-from.expect\n@@ -0,0 +1,3 @@\n+>From the depths of history, we are stuck with the\n+flaky mbox format.\n+\ndiff --git a/t/t5100/quoted-from.in b/t/t5100/quoted-from.in\nnew file mode 100644\nindex 0000000..847e1c4\n--- /dev/null\n+++ b/t/t5100/quoted-from.in\n@@ -0,0 +1,10 @@\n+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n+From: Author Name <somebody@example.com>\n+Date: Sun, 25 May 2008 00:38:18 -0700\n+Subject: [PATCH] testing quoted >From\n+\n+>From the depths of history, we are stuck with the\n+flaky mbox format.\n+\n+---\n+patch\n-- \n2.1.0.373.g91ca799\n"},{"id":"249437","messageId":"xmqqioko93au.fsf@gitster.dls.corp.google.com","threadId":"37550","inReplyTo":"20140914010120.GA28498@peff.net","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-15T17:55:21Z","receivedAt":"2014-09-15T17:55:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sat, Sep 13, 2014 at 05:55:49PM -0700, Junio C Hamano wrote:\n>\n>> On Sat, Sep 13, 2014 at 5:47 PM, Jeff King <peff@peff.net> wrote:\n>> >\n>> > On Sat, Sep 13, 2014 at 10:57:14PM +0000, brian m. carlson wrote:\n>> >\n>> > > I wonder if git send-email should do what mutt does in this case, which\n>> > > is use quoted-printable encoding and encode the first F as =46 (as well\n>> > > as any equals signs as =3D).  It looks like mailinfo.c already is\n>> > > capable of handling that, and that would avoid the entire issue.\n>> >\n>> > That's not an unreasonable tactic. However, I think we'd still want to\n>> > do something with mailinfo on the receiving end, similar to the patch I\n>> > sent. We don't know that the sending side is necessarily send-email.\n>> \n>> Hmm, isn't the \">\" stuffing in front of a beginning-of-line \"From \" purely\n>> a local matter of MUA that stores messages in (old-style) mbox format\n>> where a line that begins with \"From \" is what defines the end of the\n>> previous message?\n>\n> Yes, it is[1].\n>\n>> Why should send-email do anything when it sends individual messages\n>> separately out?\n>\n> It does not need to, but the QP-transformation helps protect against\n> other, stupider software downstream.  And unlike From-quoting it is\n> actually well-specified and reversible.\n\nOh, I was only reacting to a phantom suggestion nobody made to add\n\">\" on the sending side (which would not help anybody), but now I\nre-read the thread with a larger screen I realize nobody made such a\nsuggestion.  Sorry for a noise.\n"},{"id":"249445","messageId":"xmqqha087lwv.fsf@gitster.dls.corp.google.com","threadId":"37550","inReplyTo":"20140914013038.GA5974@peff.net","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-15T18:56:16Z","receivedAt":"2014-09-15T18:56:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> It looks like we have a reasonably sane is_from_line() function. So at\n> least _we_ will not generally break on reading our own output, except in\n> some extreme circumstances (you'd have to come up with something\n> contrived like \"From me, at 10:30 30 minutes before 11!\").\n>\n> We can pretty easily reuse this to make the from-line check in mailinfo\n> more robust. Here's a replacement for the patch I sent earlier that\n> keeps the \"magically ignore extra >From headers\" behavior but fixes the\n> case that started this discussion.\n\nWhy cache.h when this is still only between mail{info,split}.c both\nof which do not really deal with any \"Git\" data?\n\nFor mailsplit, we are trying to detect mbox boundary various MUAs\nwould use in their output, and is_from_line() may be appropriate,\nbut I am not sure if the same logic is appropriate for mailinfo.\nWhat are we trying to protect us against?  Those who paste a single\ne-mail output from format-patch in full?  Do people paste a single\ne-mail received to their mailbox from somebody else and do we need\nto protect against that, skipping the \">From \" thing, while risking\nto skip \"From me at 10:30 30 minutes...\"?\n\nIf we only want to skip \">?From\" in pasted format-patch output, we\nwould want a rule in mailinfo that is tighter than is_from_line() in\nmailsplit.\n\nBy the way, I see \">From \" in is_rfc2822_header(), too.  Do we have\nto worry about this comparison as well?\n\n> -- >8 --\n> Subject: mailinfo: make \">From\" in-body header check more robust\n>\n> Since commit 81c5cf7 (mailinfo: skip bogus UNIX From line\n> inside body, 2006-05-21), we have treated lines like \">From\"\n> in the body as headers. This makes \"git am\" work for people\n> who erroneously paste the whole mbox entry:\n>\n>   From 12345abcd...\n>   From: them\n>   Subject: [PATCH] whatever\n>\n> into their email body (assuming that an mbox writer then\n> quotes \"From\" as \">From\", as otherwise we would actually\n> mailsplit on the in-body line).\n>\n> However, this has false positives if somebody actually has a\n> commit body that starts with \"From \"; in this case we\n> erroneously remove the line entirely from the commit\n> message. We can make this check more robust by making sure\n> the line actually looks like a real mbox \"From\" line.\n>\n> To do this we pull the \"is_from_line\" definition out of\n> mailsplit, and make it available for general use.\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  Makefile                   |  1 +\n>  builtin/mailinfo.c         |  2 +-\n>  builtin/mailsplit.c        | 31 -------------------------------\n>  cache.h                    |  6 ++++++\n>  mbox.c                     | 32 ++++++++++++++++++++++++++++++++\n>  t/t5100-mailinfo.sh        | 18 ++++++++++++++++++\n>  t/t5100/embed-from.expect  |  5 +++++\n>  t/t5100/embed-from.in      | 13 +++++++++++++\n>  t/t5100/quoted-from.expect |  3 +++\n>  t/t5100/quoted-from.in     | 10 ++++++++++\n>  10 files changed, 89 insertions(+), 32 deletions(-)\n>  create mode 100644 mbox.c\n>  create mode 100644 t/t5100/embed-from.expect\n>  create mode 100644 t/t5100/embed-from.in\n>  create mode 100644 t/t5100/quoted-from.expect\n>  create mode 100644 t/t5100/quoted-from.in\n>\n> diff --git a/Makefile b/Makefile\n> index e0f15a3..e018450 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -704,6 +704,7 @@ LIB_OBJS += lockfile.o\n>  LIB_OBJS += log-tree.o\n>  LIB_OBJS += mailmap.o\n>  LIB_OBJS += match-trees.o\n> +LIB_OBJS += mbox.o\n>  LIB_OBJS += merge.o\n>  LIB_OBJS += merge-blobs.o\n>  LIB_OBJS += merge-recursive.o\n> diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c\n> index cf11c8d..a434d39 100644\n> --- a/builtin/mailinfo.c\n> +++ b/builtin/mailinfo.c\n> @@ -329,7 +329,7 @@ static int check_header(const struct strbuf *line,\n>  \n>  \t/* for inbody stuff */\n>  \tif (starts_with(line->buf, \">From\") && isspace(line->buf[5])) {\n> -\t\tret = 1; /* Should this return 0? */\n> +\t\tret = is_from_line(line->buf + 1, line->len - 1);\n>  \t\tgoto check_header_out;\n>  \t}\n>  \tif (starts_with(line->buf, \"[PATCH]\") && isspace(line->buf[7])) {\n> diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c\n> index 763cda0..11ba281 100644\n> --- a/builtin/mailsplit.c\n> +++ b/builtin/mailsplit.c\n> @@ -12,37 +12,6 @@\n>  static const char git_mailsplit_usage[] =\n>  \"git mailsplit [-d<prec>] [-f<n>] [-b] [--keep-cr] -o<directory> [(<mbox>|<Maildir>)...]\";\n>  \n> -static int is_from_line(const char *line, int len)\n> -{\n> -\tconst char *colon;\n> -\n> -\tif (len < 20 || memcmp(\"From \", line, 5))\n> -\t\treturn 0;\n> -\n> -\tcolon = line + len - 2;\n> -\tline += 5;\n> -\tfor (;;) {\n> -\t\tif (colon < line)\n> -\t\t\treturn 0;\n> -\t\tif (*--colon == ':')\n> -\t\t\tbreak;\n> -\t}\n> -\n> -\tif (!isdigit(colon[-4]) ||\n> -\t    !isdigit(colon[-2]) ||\n> -\t    !isdigit(colon[-1]) ||\n> -\t    !isdigit(colon[ 1]) ||\n> -\t    !isdigit(colon[ 2]))\n> -\t\treturn 0;\n> -\n> -\t/* year */\n> -\tif (strtol(colon+3, NULL, 10) <= 90)\n> -\t\treturn 0;\n> -\n> -\t/* Ok, close enough */\n> -\treturn 1;\n> -}\n> -\n>  static struct strbuf buf = STRBUF_INIT;\n>  static int keep_cr;\n>  \n> diff --git a/cache.h b/cache.h\n> index dfa1a56..9e71ca5 100644\n> --- a/cache.h\n> +++ b/cache.h\n> @@ -1568,4 +1568,10 @@ void stat_validity_update(struct stat_validity *sv, int fd);\n>  \n>  int versioncmp(const char *s1, const char *s2);\n>  \n> +/*\n> + * Returns true if the line appears to be an mbox \"From\" line starting a new\n> + * message.\n> + */\n> +int is_from_line(const char *line, int len);\n> +\n>  #endif /* CACHE_H */\n> diff --git a/mbox.c b/mbox.c\n> new file mode 100644\n> index 0000000..75f3150\n> --- /dev/null\n> +++ b/mbox.c\n> @@ -0,0 +1,32 @@\n> +#include \"cache.h\"\n> +\n> +int is_from_line(const char *line, int len)\n> +{\n> +\tconst char *colon;\n> +\n> +\tif (len < 20 || memcmp(\"From \", line, 5))\n> +\t\treturn 0;\n> +\n> +\tcolon = line + len - 2;\n> +\tline += 5;\n> +\tfor (;;) {\n> +\t\tif (colon < line)\n> +\t\t\treturn 0;\n> +\t\tif (*--colon == ':')\n> +\t\t\tbreak;\n> +\t}\n> +\n> +\tif (!isdigit(colon[-4]) ||\n> +\t    !isdigit(colon[-2]) ||\n> +\t    !isdigit(colon[-1]) ||\n> +\t    !isdigit(colon[ 1]) ||\n> +\t    !isdigit(colon[ 2]))\n> +\t\treturn 0;\n> +\n> +\t/* year */\n> +\tif (strtol(colon+3, NULL, 10) <= 90)\n> +\t\treturn 0;\n> +\n> +\t/* Ok, close enough */\n> +\treturn 1;\n> +}\n> diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\n> index 3e64a7a..9e1ad1c 100755\n> --- a/t/t5100-mailinfo.sh\n> +++ b/t/t5100-mailinfo.sh\n> @@ -89,4 +89,22 @@ test_expect_success 'mailinfo on from header without name works' '\n>  \n>  '\n>  \n> +test_expect_success 'mailinfo finds headers after embedded From line' '\n> +\tmkdir embed-from &&\n> +\tgit mailsplit -oembed-from \"$TEST_DIRECTORY\"/t5100/embed-from.in &&\n> +\ttest_cmp \"$TEST_DIRECTORY\"/t5100/embed-from.in embed-from/0001 &&\n> +\tgit mailinfo embed-from/msg embed-from/patch \\\n> +\t  <embed-from/0001 >embed-from/out &&\n> +\ttest_cmp \"$TEST_DIRECTORY\"/t5100/embed-from.expect embed-from/out\n> +'\n> +\n> +test_expect_success 'mailinfo on message with quoted >From' '\n> +\tmkdir quoted-from &&\n> +\tgit mailsplit -oquoted-from \"$TEST_DIRECTORY\"/t5100/quoted-from.in &&\n> +\ttest_cmp \"$TEST_DIRECTORY\"/t5100/quoted-from.in quoted-from/0001 &&\n> +\tgit mailinfo quoted-from/msg quoted-from/patch \\\n> +\t  <quoted-from/0001 >quoted-from/out &&\n> +\ttest_cmp \"$TEST_DIRECTORY\"/t5100/quoted-from.expect quoted-from/msg\n> +'\n> +\n>  test_done\n> diff --git a/t/t5100/embed-from.expect b/t/t5100/embed-from.expect\n> new file mode 100644\n> index 0000000..06a3a38\n> --- /dev/null\n> +++ b/t/t5100/embed-from.expect\n> @@ -0,0 +1,5 @@\n> +Author: Commit Author\n> +Email: commit@example.com\n> +Subject: patch subject\n> +Date: Sat, 13 Sep 2014 21:13:23 -0400 \n> +\n> diff --git a/t/t5100/embed-from.in b/t/t5100/embed-from.in\n> new file mode 100644\n> index 0000000..5f3f84e\n> --- /dev/null\n> +++ b/t/t5100/embed-from.in\n> @@ -0,0 +1,13 @@\n> +From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n> +From: Email Author <email@example.com>\n> +Date: Sun, 25 May 2008 00:38:18 -0700\n> +Subject: [PATCH] email subject\n> +\n> +>From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n> +From: Commit Author <commit@example.com>\n> +Date: Sat, 13 Sep 2014 21:13:23 -0400\n> +Subject: patch subject\n> +\n> +patch body\n> +---\n> +patch\n> diff --git a/t/t5100/quoted-from.expect b/t/t5100/quoted-from.expect\n> new file mode 100644\n> index 0000000..8c9d48c\n> --- /dev/null\n> +++ b/t/t5100/quoted-from.expect\n> @@ -0,0 +1,3 @@\n> +>From the depths of history, we are stuck with the\n> +flaky mbox format.\n> +\n> diff --git a/t/t5100/quoted-from.in b/t/t5100/quoted-from.in\n> new file mode 100644\n> index 0000000..847e1c4\n> --- /dev/null\n> +++ b/t/t5100/quoted-from.in\n> @@ -0,0 +1,10 @@\n> +From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n> +From: Author Name <somebody@example.com>\n> +Date: Sun, 25 May 2008 00:38:18 -0700\n> +Subject: [PATCH] testing quoted >From\n> +\n> +>From the depths of history, we are stuck with the\n> +flaky mbox format.\n> +\n> +---\n> +patch\n"},{"id":"249457","messageId":"xmqq1trc63o8.fsf@gitster.dls.corp.google.com","threadId":"37550","inReplyTo":"xmqqha087lwv.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-15T20:15:35Z","receivedAt":"2014-09-15T20:15:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Why cache.h when this is still only between mail{info,split}.c both\n> of which do not really deal with any \"Git\" data?\n>\n> For mailsplit, we are trying to detect mbox boundary various MUAs\n> would use in their output, and is_from_line() may be appropriate,\n> but I am not sure if the same logic is appropriate for mailinfo.\n> What are we trying to protect us against?  Those who paste a single\n> e-mail output from format-patch in full?  Do people paste a single\n> e-mail received to their mailbox from somebody else and do we need\n> to protect against that, skipping the \">From \" thing, while risking\n> to skip \"From me at 10:30 30 minutes...\"?\n>\n> If we only want to skip \">?From\" in pasted format-patch output, we\n> would want a rule in mailinfo that is tighter than is_from_line() in\n> mailsplit.\n\nThat is, something like this on top of your patch.  Or is this a bit\ntoo strict?\n\n Makefile            |  1 +\n builtin/mailinfo.c  |  3 ++-\n builtin/mailsplit.c |  1 +\n cache.h             |  6 ------\n mbox.c              | 15 +++++++++++++++\n 5 files changed, 19 insertions(+), 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex dc5d2af..c0491a3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -686,6 +686,7 @@ LIB_H += list-objects.h\n LIB_H += ll-merge.h\n LIB_H += log-tree.h\n LIB_H += mailmap.h\n+LIB_H += mbox.h\n LIB_H += merge-blobs.h\n LIB_H += merge-recursive.h\n LIB_H += mergesort.h\ndiff --git a/builtin/mailinfo.c b/builtin/mailinfo.c\nindex a434d39..ccccd69 100644\n--- a/builtin/mailinfo.c\n+++ b/builtin/mailinfo.c\n@@ -6,6 +6,7 @@\n #include \"builtin.h\"\n #include \"utf8.h\"\n #include \"strbuf.h\"\n+#include \"mbox.h\"\n \n static FILE *cmitmsg, *patchfile, *fin, *fout;\n \n@@ -329,7 +330,7 @@ static int check_header(const struct strbuf *line,\n \n \t/* for inbody stuff */\n \tif (starts_with(line->buf, \">From\") && isspace(line->buf[5])) {\n-\t\tret = is_from_line(line->buf + 1, line->len - 1);\n+\t\tret = is_format_patch_separator(line->buf + 1, line->len - 1);\n \t\tgoto check_header_out;\n \t}\n \tif (starts_with(line->buf, \"[PATCH]\") && isspace(line->buf[7])) {\ndiff --git a/builtin/mailsplit.c b/builtin/mailsplit.c\nindex 775588e..d8da1e4 100644\n--- a/builtin/mailsplit.c\n+++ b/builtin/mailsplit.c\n@@ -8,6 +8,7 @@\n #include \"builtin.h\"\n #include \"string-list.h\"\n #include \"strbuf.h\"\n+#include \"mbox.h\"\n \n static const char git_mailsplit_usage[] =\n \"git mailsplit [-d<prec>] [-f<n>] [-b] [--keep-cr] -o<directory> [(<mbox>|<Maildir>)...]\";\ndiff --git a/cache.h b/cache.h\nindex eae58e7..fcb511d 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1502,10 +1502,4 @@ void stat_validity_update(struct stat_validity *sv, int fd);\n \n int versioncmp(const char *s1, const char *s2);\n \n-/*\n- * Returns true if the line appears to be an mbox \"From\" line starting a new\n- * message.\n- */\n-int is_from_line(const char *line, int len);\n-\n #endif /* CACHE_H */\ndiff --git a/mbox.c b/mbox.c\nindex 75f3150..2ab2f85 100644\n--- a/mbox.c\n+++ b/mbox.c\n@@ -30,3 +30,18 @@ int is_from_line(const char *line, int len)\n \t/* Ok, close enough */\n \treturn 1;\n }\n+\n+#define SAMPLE \"From e6807f3efca28b30decfecb1732a56c7db1137ee Mon Sep 17 00:00:00 2001\\n\"\n+int is_format_patch_separator(const char *line, int len)\n+{\n+\tconst char *cp;\n+\n+\tif (len != strlen(SAMPLE))\n+\t\treturn 0;\n+\tif (!skip_prefix(line, \"From \", &cp))\n+\t\treturn 0;\n+\tif (strspn(cp, \"0123456789abcdef\") != 40)\n+\t\treturn 0;\n+\tcp += 40;\n+\treturn !memcmp(SAMPLE + (cp - line), cp, strlen(SAMPLE) - (cp - line));\n+}\n"},{"id":"249496","messageId":"20140916001242.GB5019@peff.net","threadId":"37550","inReplyTo":"xmqqha087lwv.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-16T00:12:42Z","receivedAt":"2014-09-16T00:12:42Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Sep 15, 2014 at 11:56:16AM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > It looks like we have a reasonably sane is_from_line() function. So at\n> > least _we_ will not generally break on reading our own output, except in\n> > some extreme circumstances (you'd have to come up with something\n> > contrived like \"From me, at 10:30 30 minutes before 11!\").\n> >\n> > We can pretty easily reuse this to make the from-line check in mailinfo\n> > more robust. Here's a replacement for the patch I sent earlier that\n> > keeps the \"magically ignore extra >From headers\" behavior but fixes the\n> > case that started this discussion.\n> \n> Why cache.h when this is still only between mail{info,split}.c both\n> of which do not really deal with any \"Git\" data?\n\nMy thought process was basically:\n\n  1. It should go into libgit.a, so we don't end up with an accidental\n     libgit->builtin dependency.\n\n  2. It is only one function, and we seem to stuff everything into\n     cache.h, so it is probably not a big deal to do it there.\n\nI'd be happy with mbox.h, too.\n\n> For mailsplit, we are trying to detect mbox boundary various MUAs\n> would use in their output, and is_from_line() may be appropriate,\n> but I am not sure if the same logic is appropriate for mailinfo.\n> What are we trying to protect us against?  Those who paste a single\n> e-mail output from format-patch in full?  Do people paste a single\n> e-mail received to their mailbox from somebody else and do we need\n> to protect against that, skipping the \">From \" thing, while risking\n> to skip \"From me at 10:30 30 minutes...\"?\n> \n> If we only want to skip \">?From\" in pasted format-patch output, we\n> would want a rule in mailinfo that is tighter than is_from_line() in\n> mailsplit.\n\nYes, the current is_from_line is much looser than we need here. It must\nparse lines from an arbitrary writer, and you are right that here we are\nspecifically interested in git header-lines (at least that is the\nrationale given by your 81c5cf7, and what I was trying to preserve).\n\nI mostly just didn't think it mattered much. Despite coming up with a\nsilly false positive, I doubt it would happen in practice (remember that\nin addition to matching, it must _also_ be in an in-body header block at\nthe start of the body).\n\n> By the way, I see \">From \" in is_rfc2822_header(), too.  Do we have\n> to worry about this comparison as well?\n\nI don't think so. We call that from read_one_header_line, which is used\nwhen running through the _real_ rfc2822 header. Such a \">From\" line\nthere would not make any sense (we skip \"From\" at arbitrary points in\nthe header, too, which is kind of weird; our real goal is to skip the\ninitial one, which we could do separately). But it does not hurt to be\noverly aggressive in eating them there, as they cannot possibly be body\nlines.\n\nWe do the same thing after a multipart boundary, so if you had:\n\n  <regular rfc2822 email headers>\n  Content-Type: multipart/mixed; boundary=foo\n\n  --foo\n  Content-Type: text/plain\n\n  your message\n\n  --foo\n  Content-Type: message/rfc822\n\n  From blah blah blah\n  <commit's rfc2822 email headers>\n\n  --foo--\n\nthen I guess it would help. I am not sure that doing so is actually\nvalid (you do not need the mbox splitter inside the multipart, and it is\nactively wrong and a potential danger to mbox readers to put it there).\nBut if you did put it there, _and_ an mbox writer quoted that line to\n\">From\", I guess we would want to ignore it.\n\nSo from my reading (and I am not 100% sure that I am not missing\nsomething), I think we could be much stricter in our parsing there. But\ngiven that it is not causing any problems, and has been that way for\nquite a while, I am quite hesitant to change it.\n\n-Peff\n"},{"id":"249497","messageId":"20140916001948.GC5019@peff.net","threadId":"37550","inReplyTo":"xmqq1trc63o8.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-16T00:19:49Z","receivedAt":"2014-09-16T00:19:49Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Sep 15, 2014 at 01:15:35PM -0700, Junio C Hamano wrote:\n\n> > If we only want to skip \">?From\" in pasted format-patch output, we\n> > would want a rule in mailinfo that is tighter than is_from_line() in\n> > mailsplit.\n> \n> That is, something like this on top of your patch.  Or is this a bit\n> too strict?\n\nThe only cases that I can think of that would be a problem with this\nstrictness are:\n\n  1. Somebody writes format-patch output to a file, reads in the mbox\n     using another program, and then writes out the result (munging the\n     mbox From line). And then pastes the whole thing into their email\n     body.\n\n     I can see the first part happening. But given that it is totally\n     irrelevant _unless_ they then screw up and paste the From line in\n     the body (which is already a corner case), it probably doesn't\n     matter.\n\n  2. We change the static From lines that git generates. We can always\n     update the parser, of course, but it may be running a different\n     version of git than the sender.  People with an old git running\n     \"git am\" would stop skipping past \"From\" lines in messages from\n     people on newer gits.\n\nAgain, this eating of the in-body \"From\" line is already a corner case,\nso it's not the end of the world if it breaks in a few cases. But I'd\nalso be fine with just leaving it looser.\n\n>  Makefile            |  1 +\n>  builtin/mailinfo.c  |  3 ++-\n>  builtin/mailsplit.c |  1 +\n>  cache.h             |  6 ------\n>  mbox.c              | 15 +++++++++++++++\n>  5 files changed, 19 insertions(+), 7 deletions(-)\n\nI think you forgot to \"git add\" mbox.h. That being said, if we did go\nthis route, I do not see any reason to share the code at all. This can\nbe purely a mailinfo.c thing.\n\n-Peff\n"},{"id":"249508","messageId":"xmqqy4tj30ny.fsf@gitster.dls.corp.google.com","threadId":"37550","inReplyTo":"20140916001948.GC5019@peff.net","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-16T18:01:05Z","receivedAt":"2014-09-16T18:01:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> The only cases that I can think of that would be a problem with this\n> strictness are:\n>\n>   1. Somebody writes format-patch output to a file, reads in the mbox\n>      using another program, and then writes out the result (munging the\n>      mbox From line). And then pastes the whole thing into their email\n>      body.\n>\n>      I can see the first part happening. But given that it is totally\n>      irrelevant _unless_ they then screw up and paste the From line in\n>      the body (which is already a corner case), it probably doesn't\n>      matter.\n\nYeah, I tend to agree.\n\n>   2. We change the static From lines that git generates. We can always\n>      update the parser, of course, but it may be running a different\n>      version of git than the sender.  People with an old git running\n>      \"git am\" would stop skipping past \"From\" lines in messages from\n>      people on newer gits.\n\nI hope that it is not going to happen; the reason we refrain from\never changing the datestamp has been to keep it constant to help\nthose who write magic(5), and I do not think we have a reason to\ndefeat that.\n\n> I think you forgot to \"git add\" mbox.h. That being said, if we did go\n> this route, I do not see any reason to share the code at all. This can\n> be purely a mailinfo.c thing.\n\nOK.  A reroll coming today when I find time.\n"},{"id":"249516","messageId":"xmqq38br2yt7.fsf@gitster.dls.corp.google.com","threadId":"37550","inReplyTo":"xmqqy4tj30ny.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-16T18:41:08Z","receivedAt":"2014-09-16T18:41:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> I think you forgot to \"git add\" mbox.h. That being said, if we did go\n>> this route, I do not see any reason to share the code at all. This can\n>> be purely a mailinfo.c thing.\n>\n> OK.  A reroll coming today when I find time.\n\n-- >8 --\nFrom: Jeff King <peff@peff.net>\nDate: Sat, 13 Sep 2014 21:30:38 -0400\nSubject: [PATCH] mailinfo: make \">From\" in-body header check more robust\n\nSince commit 81c5cf7 (mailinfo: skip bogus UNIX From line inside\nbody, 2006-05-21), we have treated lines like \">From\" in the body as\nheaders. This makes \"git am\" work for people who erroneously paste\nthe whole output from format-patch:\n\n  From 12345abcd...fedcba543210 Mon Sep 17 00:00:00 2001\n  From: them\n  Subject: [PATCH] whatever\n\ninto their email body (assuming that an mbox writer then quotes\n\"From\" as \">From\", as otherwise we would actually mailsplit on the\nin-body line).\n\nHowever, this has false positives if somebody actually has a commit\nbody that starts with \"From \"; in this case we erroneously remove\nthe line entirely from the commit message. We can make this check\nmore robust by making sure the line actually looks like a real mbox\n\"From\" line.\n\nInspect the line that begins with \">From \" a more carefully to only\nskip lines that match the expected pattern (note that the datestamp\npart of the format-patch output is designed to be kept constant to\nhelp those who write magic(5) entries).\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/mailinfo.c         | 17 ++++++++++++++++-\n t/t5100-mailinfo.sh        | 18 ++++++++++++++++++\n t/t5100/embed-from.expect  |  5 +++++\n t/t5100/embed-from.in      | 13 +++++++++++++\n t/t5100/quoted-from.expect |  3 +++\n t/t5100/quoted-from.in     | 10 ++++++++++\n 6 files changed, 65 insertions(+), 1 deletion(-)\n create mode 100644 t/t5100/embed-from.expect\n create mode 100644 t/t5100/embed-from.in\n create mode 100644 t/t5100/quoted-from.expect\n create mode 100644 t/t5100/quoted-from.in\n\ndiff --git a/builtin/mailinfo.c b/builtin/mailinfo.c\nindex cf11c8d..2632fb0 100644\n--- a/builtin/mailinfo.c\n+++ b/builtin/mailinfo.c\n@@ -288,6 +288,21 @@ static inline int cmp_header(const struct strbuf *line, const char *hdr)\n \t\t\tline->buf[len] == ':' && isspace(line->buf[len + 1]);\n }\n \n+#define SAMPLE \"From e6807f3efca28b30decfecb1732a56c7db1137ee Mon Sep 17 00:00:00 2001\\n\"\n+static int is_format_patch_separator(const char *line, int len)\n+{\n+\tconst char *cp;\n+\n+\tif (len != strlen(SAMPLE))\n+\t\treturn 0;\n+\tif (!skip_prefix(line, \"From \", &cp))\n+\t\treturn 0;\n+\tif (strspn(cp, \"0123456789abcdef\") != 40)\n+\t\treturn 0;\n+\tcp += 40;\n+\treturn !memcmp(SAMPLE + (cp - line), cp, strlen(SAMPLE) - (cp - line));\n+}\n+\n static int check_header(const struct strbuf *line,\n \t\t\t\tstruct strbuf *hdr_data[], int overwrite)\n {\n@@ -329,7 +344,7 @@ static int check_header(const struct strbuf *line,\n \n \t/* for inbody stuff */\n \tif (starts_with(line->buf, \">From\") && isspace(line->buf[5])) {\n-\t\tret = 1; /* Should this return 0? */\n+\t\tret = is_format_patch_separator(line->buf + 1, line->len - 1);\n \t\tgoto check_header_out;\n \t}\n \tif (starts_with(line->buf, \"[PATCH]\") && isspace(line->buf[7])) {\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex 3e64a7a..9e1ad1c 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -89,4 +89,22 @@ test_expect_success 'mailinfo on from header without name works' '\n \n '\n \n+test_expect_success 'mailinfo finds headers after embedded From line' '\n+\tmkdir embed-from &&\n+\tgit mailsplit -oembed-from \"$TEST_DIRECTORY\"/t5100/embed-from.in &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/embed-from.in embed-from/0001 &&\n+\tgit mailinfo embed-from/msg embed-from/patch \\\n+\t  <embed-from/0001 >embed-from/out &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/embed-from.expect embed-from/out\n+'\n+\n+test_expect_success 'mailinfo on message with quoted >From' '\n+\tmkdir quoted-from &&\n+\tgit mailsplit -oquoted-from \"$TEST_DIRECTORY\"/t5100/quoted-from.in &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/quoted-from.in quoted-from/0001 &&\n+\tgit mailinfo quoted-from/msg quoted-from/patch \\\n+\t  <quoted-from/0001 >quoted-from/out &&\n+\ttest_cmp \"$TEST_DIRECTORY\"/t5100/quoted-from.expect quoted-from/msg\n+'\n+\n test_done\ndiff --git a/t/t5100/embed-from.expect b/t/t5100/embed-from.expect\nnew file mode 100644\nindex 0000000..06a3a38\n--- /dev/null\n+++ b/t/t5100/embed-from.expect\n@@ -0,0 +1,5 @@\n+Author: Commit Author\n+Email: commit@example.com\n+Subject: patch subject\n+Date: Sat, 13 Sep 2014 21:13:23 -0400 \n+\ndiff --git a/t/t5100/embed-from.in b/t/t5100/embed-from.in\nnew file mode 100644\nindex 0000000..5f3f84e\n--- /dev/null\n+++ b/t/t5100/embed-from.in\n@@ -0,0 +1,13 @@\n+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n+From: Email Author <email@example.com>\n+Date: Sun, 25 May 2008 00:38:18 -0700\n+Subject: [PATCH] email subject\n+\n+>From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n+From: Commit Author <commit@example.com>\n+Date: Sat, 13 Sep 2014 21:13:23 -0400\n+Subject: patch subject\n+\n+patch body\n+---\n+patch\ndiff --git a/t/t5100/quoted-from.expect b/t/t5100/quoted-from.expect\nnew file mode 100644\nindex 0000000..8c9d48c\n--- /dev/null\n+++ b/t/t5100/quoted-from.expect\n@@ -0,0 +1,3 @@\n+>From the depths of history, we are stuck with the\n+flaky mbox format.\n+\ndiff --git a/t/t5100/quoted-from.in b/t/t5100/quoted-from.in\nnew file mode 100644\nindex 0000000..847e1c4\n--- /dev/null\n+++ b/t/t5100/quoted-from.in\n@@ -0,0 +1,10 @@\n+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001\n+From: Author Name <somebody@example.com>\n+Date: Sun, 25 May 2008 00:38:18 -0700\n+Subject: [PATCH] testing quoted >From\n+\n+>From the depths of history, we are stuck with the\n+flaky mbox format.\n+\n+---\n+patch\n-- \n2.1.0-420-g23b5121\n"},{"id":"249559","messageId":"20140916202903.GB31398@peff.net","threadId":"37550","inReplyTo":"xmqq38br2yt7.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC/PATCH] mailinfo: do not treat \">From\" lines as in-body headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-09-16T20:29:03Z","receivedAt":"2014-09-16T20:29:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 16, 2014 at 11:41:08AM -0700, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> >> I think you forgot to \"git add\" mbox.h. That being said, if we did go\n> >> this route, I do not see any reason to share the code at all. This can\n> >> be purely a mailinfo.c thing.\n> >\n> > OK.  A reroll coming today when I find time.\n> \n> -- >8 --\n> From: Jeff King <peff@peff.net>\n> Date: Sat, 13 Sep 2014 21:30:38 -0400\n> Subject: [PATCH] mailinfo: make \">From\" in-body header check more robust\n>[...]\n\nThis looks good to me. Thanks.\n\n-Peff\n"}]}