{"thread":{"id":"21980","subject":"[PATCH] am: fix patch format detection for Thunderbird \"Save As\" emails","startedAt":"2009-12-17T23:58:19Z","lastAt":"2010-01-21T18:51:31Z","messageCount":16,"participants":["Stephen Boyd","Junio C Hamano","Eric Blake","Andreas Schwab","Nanako Shiraishi"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"130047","messageId":"1261094299-22930-1-git-send-email-bebarino@gmail.com","threadId":"21980","inReplyTo":null,"subject":"[PATCH] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-12-17T23:58:19Z","receivedAt":"2009-12-17T23:58:19Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"The patch detection wants to inspect all the headers of a rfc2822 message\nand ensure that they look like header field names. The headers are always\nseparated from the message body with a blank line. When Thunderbird3 saves\nthe message the blank line separating the headers from the body includes a\nCR. The patch detection is failing because a CRLF doesn't match /^$/. Fix\nthis by allowing a CR to exist on the separating line.\n---\n\nI'm not sure how portable \\r in a sed invocation is. Perhaps just checking\nthat l1, l2, and l3 are rfc2822 header fields (or indented lines) is better\nthan trying to check all of the headers?\n\nThis seems related to\n\n  am fails to apply patches for files with CRLF lineendings\n  http://article.gmane.org/gmane.comp.version-control.git/135229\n\nbut seems necessary because check_patch_format() is called before any\nsplitting with mailsplit is done (where I assume the fix for the issue\nwill be done).\n\n git-am.sh     |    2 +-\n t/t4150-am.sh |   15 +++++++++++++++\n 2 files changed, 16 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 4838cdb..bb106b7 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -204,7 +204,7 @@ check_patch_format () {\n \t\t\t# discarding the indented remainder of folded lines,\n \t\t\t# and see if it looks like that they all begin with the\n \t\t\t# header field names...\n-\t\t\tsed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n+\t\t\tsed -n -e '/^\\r*$/q' -e '/^[ \t]/d' -e p \"$1\" |\n \t\t\tsane_egrep -v '^[!-9;-~]+:' >/dev/null ||\n \t\t\tpatch_format=mbox\n \t\tfi\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 8296605..578bc81 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -83,6 +83,12 @@ test_expect_success setup '\n \t\techo \"X-Fake-Field: Line Three\" &&\n \t\tgit format-patch --stdout first | sed -e \"1d\"\n \t} > patch1.eml &&\n+\t{\n+\t\techo \"X-Fake-Field: Line One\" &&\n+\t\techo \"X-Fake-Field: Line Two\" &&\n+\t\techo \"X-Fake-Field: Line Three\" &&\n+\t\tgit format-patch --stdout first | sed -e \"1d\"\n+\t} | sed -e \"s/$/\\r/\" > patch1-crlf.eml &&\n \tsed -n -e \"3,\\$p\" msg >file &&\n \tgit add file &&\n \ttest_tick &&\n@@ -123,6 +129,15 @@ test_expect_success 'am applies patch e-mail not in a mbox' '\n \ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n '\n \n+test_expect_success 'am applies patch e-mail not in a mbox with CRLF' '\n+\tgit checkout first &&\n+\tgit am patch1-crlf.eml &&\n+\t! test -d .git/rebase-apply &&\n+\ttest -z \"$(git diff second)\" &&\n+\ttest \"$(git rev-parse second)\" = \"$(git rev-parse HEAD)\" &&\n+\ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n+'\n+\n GIT_AUTHOR_NAME=\"Another Thor\"\n GIT_AUTHOR_EMAIL=\"a.thor@example.com\"\n GIT_COMMITTER_NAME=\"Co M Miter\"\n-- \n1.6.6.rc3.1.g8df51\n"},{"id":"130051","messageId":"7vtyvpcf36.fsf@alter.siamese.dyndns.org","threadId":"21980","inReplyTo":"1261094299-22930-1-git-send-email-bebarino@gmail.com","subject":"Re: [PATCH] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-18T00:15:25Z","receivedAt":"2009-12-18T00:15:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> I'm not sure how portable \\r in a sed invocation is.\n\nNot very portable.\n\nAdding\n\n\ttr -d '\\015' <\"$1\" |\n\nin front of the original \"sed\" invocation might be a better choice.\n\n> but seems necessary because check_patch_format() is called before any\n> splitting with mailsplit is done (where I assume the fix for the issue\n> will be done).\n\nI agree that the way non-native mbox format was bolted onto \"am\" is\nsomewhat unfortunate.\n"},{"id":"130098","messageId":"1261172078-9174-1-git-send-email-bebarino@gmail.com","threadId":"21980","inReplyTo":"7vtyvpcf36.fsf@alter.siamese.dyndns.org","subject":"[PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-12-18T21:34:38Z","receivedAt":"2009-12-18T21:34:38Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"The patch detection wants to inspect all the headers of a rfc2822 message\nand ensure that they look like header field names. The headers are always\nseparated from the message body with a blank line. When Thunderbird saves\nthe message the blank line separating the headers from the body includes a\nCR. The patch detection is failing because a CRLF doesn't match /^$/. Fix\nthis by allowing a CR to exist on the separating line.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n\nChanges since v1:\n - More portable code using tr (thanks Junio)\n - More portable testing by manually adding CRLFs\n\n git-am.sh     |    3 ++-\n t/t4150-am.sh |   24 ++++++++++++++++++++++++\n 2 files changed, 26 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 4838cdb..9e64deb 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -204,7 +204,8 @@ check_patch_format () {\n \t\t\t# discarding the indented remainder of folded lines,\n \t\t\t# and see if it looks like that they all begin with the\n \t\t\t# header field names...\n-\t\t\tsed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n+\t\t\ttr -d '\\015' <\"$1\" |\n+\t\t\tsed -n -e '/^$/q' -e '/^[ \t]/d' -e p |\n \t\t\tsane_egrep -v '^[!-9;-~]+:' >/dev/null ||\n \t\t\tpatch_format=mbox\n \t\tfi\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 8296605..7b6269d 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -83,6 +83,21 @@ test_expect_success setup '\n \t\techo \"X-Fake-Field: Line Three\" &&\n \t\tgit format-patch --stdout first | sed -e \"1d\"\n \t} > patch1.eml &&\n+\t{\n+\t\techo \"X-Fake-Field: Line One\\015\" &&\n+\t\techo \"X-Fake-Field: Line Two\\015\" &&\n+\t\techo \"X-Fake-Field: Line Three\\015\" &&\n+\t\tgit format-patch --stdout first |\n+\t\tsed -e \"1d\" -e \"3,\\$d\" | tr -d \"\\n\" &&\n+\t\techo \"\\015\" &&\n+\t\tgit format-patch --stdout first |\n+\t\tsed -e \"1,2d\" -e \"4,\\$d\" | tr -d \"\\n\" &&\n+\t\techo \"\\015\" &&\n+\t\tgit format-patch --stdout first |\n+\t\tsed -e \"1,3d\" -e \"5,\\$d\" | tr -d \"\\n\" &&\n+\t\techo \"\\015\\n\\015\" &&\n+\t\tgit format-patch --stdout first | sed -e \"1,5d\"\n+\t} > patch1-crlf.eml &&\n \tsed -n -e \"3,\\$p\" msg >file &&\n \tgit add file &&\n \ttest_tick &&\n@@ -123,6 +138,15 @@ test_expect_success 'am applies patch e-mail not in a mbox' '\n \ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n '\n \n+test_expect_success 'am applies patch e-mail not in a mbox with CRLF' '\n+\tgit checkout first &&\n+\tgit am patch1-crlf.eml &&\n+\t! test -d .git/rebase-apply &&\n+\ttest -z \"$(git diff second)\" &&\n+\ttest \"$(git rev-parse second)\" = \"$(git rev-parse HEAD)\" &&\n+\ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n+'\n+\n GIT_AUTHOR_NAME=\"Another Thor\"\n GIT_AUTHOR_EMAIL=\"a.thor@example.com\"\n GIT_COMMITTER_NAME=\"Co M Miter\"\n-- \n1.6.6.rc3.1.g8df51\n"},{"id":"130100","messageId":"loom.20091218T223918-175@post.gmane.org","threadId":"21980","inReplyTo":"1261172078-9174-1-git-send-email-bebarino@gmail.com","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Eric Blake","fromEmail":"ebb9@byu.net","sentAt":"2009-12-18T21:42:49Z","receivedAt":"2009-12-18T21:42:49Z","isPatch":false,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"Stephen Boyd <bebarino <at> gmail.com> writes:\n\n> +\t{\n> +\t\techo \"X-Fake-Field: Line One\\015\" &&\n\necho and \\ do not portably mix.  For that matter, shell double quotes and \nbackslash escapes that are not required by POSIX do not portably mix.  To \nreliably create carriage returns in shell, you need to use printf, or else \nsomething like:\n\necho \"...@\" | tr '@' '\\015'\n\n-- \nEric Blake\n"},{"id":"130101","messageId":"1261173577.14059.5.camel@swboyd-laptop","threadId":"21980","inReplyTo":"loom.20091218T223918-175@post.gmane.org","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-12-18T21:59:37Z","receivedAt":"2009-12-18T21:59:37Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Fri, 2009-12-18 at 21:42 +0000, Eric Blake wrote:\n> Stephen Boyd <bebarino <at> gmail.com> writes:\n> \n> > +\t{\n> > +\t\techo \"X-Fake-Field: Line One\\015\" &&\n> \n> echo and \\ do not portably mix.  For that matter, shell double quotes and \n> backslash escapes that are not required by POSIX do not portably mix.  To \n> reliably create carriage returns in shell, you need to use printf, or else \n> something like:\n> \n> echo \"...@\" | tr '@' '\\015'\n> \n\nThanks. Hopefully squashing this in will make it even more portable?\n\n--->8---\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 7b6269d..19d5ca1 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -84,18 +84,18 @@ test_expect_success setup '\n                git format-patch --stdout first | sed -e \"1d\"\n        } > patch1.eml &&\n        {\n-               echo \"X-Fake-Field: Line One\\015\" &&\n-               echo \"X-Fake-Field: Line Two\\015\" &&\n-               echo \"X-Fake-Field: Line Three\\015\" &&\n+               printf \"X-Fake-Field: Line One\\015\\n\" &&\n+               printf \"X-Fake-Field: Line Two\\015\\n\" &&\n+               printf \"X-Fake-Field: Line Three\\015\\n\" &&\n                git format-patch --stdout first |\n                sed -e \"1d\" -e \"3,\\$d\" | tr -d \"\\n\" &&\n-               echo \"\\015\" &&\n+               printf \"\\015\\n\" &&\n                git format-patch --stdout first |\n                sed -e \"1,2d\" -e \"4,\\$d\" | tr -d \"\\n\" &&\n-               echo \"\\015\" &&\n+               printf \"\\015\\n\" &&\n                git format-patch --stdout first |\n                sed -e \"1,3d\" -e \"5,\\$d\" | tr -d \"\\n\" &&\n-               echo \"\\015\\n\\015\" &&\n+               printf \"\\015\\n\\015\\n\" &&\n                git format-patch --stdout first | sed -e \"1,5d\"\n        } > patch1-crlf.eml &&\n        sed -n -e \"3,\\$p\" msg >file &&\n"},{"id":"130105","messageId":"loom.20091218T234129-280@post.gmane.org","threadId":"21980","inReplyTo":"1261173577.14059.5.camel@swboyd-laptop","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Eric Blake","fromEmail":"ebb9@byu.net","sentAt":"2009-12-18T22:42:28Z","receivedAt":"2009-12-18T22:42:28Z","isPatch":false,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"Stephen Boyd <bebarino <at> gmail.com> writes:\n\n> > echo and \\ do not portably mix.  For that matter, shell double quotes and \n> > backslash escapes that are not required by POSIX do not portably mix.\n> \n> Thanks. Hopefully squashing this in will make it even more portable?\n> \n> +               printf \"X-Fake-Field: Line One\\015\\n\" &&\n\nNope.  You need either \"\\\\015\\\\n\" or '\\015\\n', since \"\\015\" and \"\\n\" are both \nundefined in portable shell.\n\n-- \nEric Blake\n"},{"id":"130108","messageId":"7vmy1fsv0e.fsf@alter.siamese.dyndns.org","threadId":"21980","inReplyTo":"loom.20091218T223918-175@post.gmane.org","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-18T23:49:21Z","receivedAt":"2009-12-18T23:49:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Blake <ebb9@byu.net> writes:\n\n> Stephen Boyd <bebarino <at> gmail.com> writes:\n>\n>> +\t{\n>> +\t\techo \"X-Fake-Field: Line One\\015\" &&\n>\n> echo and \\ do not portably mix.  For that matter, shell double quotes and \n> backslash escapes that are not required by POSIX do not portably mix.  To \n> reliably create carriage returns in shell, you need to use printf, or else \n> something like:\n>\n> echo \"...@\" | tr '@' '\\015'\n\nThanks.\n\nAlso we probably want to change the \"only munge the first three lines\" to\nsomething like:\n\n\tformat-patch --stdout |\n        sed -e 's/$/Q/' |\n        tr 'Q' '\\015'\n\npicking some 'Q' that we know does not appear in the text.\n"},{"id":"130115","messageId":"4B2C395A.6080300@gmail.com","threadId":"21980","inReplyTo":"loom.20091218T234129-280@post.gmane.org","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-12-19T02:24:26Z","receivedAt":"2009-12-19T02:24:26Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 12/18/2009 02:42 PM, Eric Blake wrote:\n> Stephen Boyd<bebarino<at>  gmail.com>  writes:\n>>> echo and \\ do not portably mix.  For that matter, shell double quotes and\n>>> backslash escapes that are not required by POSIX do not portably mix.\n>>\n>> Thanks. Hopefully squashing this in will make it even more portable?\n>>\n>> +               printf \"X-Fake-Field: Line One\\015\\n\"&&\n>\n> Nope.  You need either \"\\\\015\\\\n\" or '\\015\\n', since \"\\015\" and \"\\n\" are both\n> undefined in portable shell.\n\nSo, how about this?\n\n         {\n                 echo \"X-Fake-Field: Line One\"&&\n                 echo \"X-Fake-Field: Line Two\"&&\n                 echo \"X-Fake-Field: Line Three\"&&\n                 git format-patch --stdout first | sed -e \"1d\"\n         } | sed -e \"s/$/;/\" | tr \"'\";\"'\" \"'\"\\015\"'\">  patch1-crlf.eml\n\nOr maybe this?\n\n         {\n                 echo \"X-Fake-Field: Line One\"&&\n                 echo \"X-Fake-Field: Line Two\"&&\n                 echo \"X-Fake-Field: Line Three\"&&\n                 git format-patch --stdout first | sed -e \"1d\"\n         } | sed -e \"s/$/;/\" | tr \";\" \"\\\\015\">  patch1-crlf.eml\n"},{"id":"130122","messageId":"4B2C66D3.1070508@byu.net","threadId":"21980","inReplyTo":"4B2C395A.6080300@gmail.com","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Eric Blake","fromEmail":"ebb9@byu.net","sentAt":"2009-12-19T05:38:27Z","receivedAt":"2009-12-19T05:38:27Z","isPatch":false,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"According to Stephen Boyd on 12/18/2009 7:24 PM:\n>> Nope.  You need either \"\\\\015\\\\n\" or '\\015\\n', since \"\\015\" and \"\\n\"\n>> are both\n>> undefined in portable shell.\n> \n> So, how about this?\n> \n>         {\n>                 echo \"X-Fake-Field: Line One\"&&\n>                 echo \"X-Fake-Field: Line Two\"&&\n>                 echo \"X-Fake-Field: Line Three\"&&\n>                 git format-patch --stdout first | sed -e \"1d\"\n>         } | sed -e \"s/$/;/\" | tr \"'\";\"'\" \"'\"\\015\"'\">  patch1-crlf.eml\n\nSyntax error.  \"$/\" is not defined, so the argument to sed is not\nportable.  Then, following the tr, you have an unquoted ;, meaning you\ninvoked 'tr \"'\"', followed by invoking the (non-existent) command '.\n\n> \n> Or maybe this?\n> \n>         {\n>                 echo \"X-Fake-Field: Line One\"&&\n>                 echo \"X-Fake-Field: Line Two\"&&\n>                 echo \"X-Fake-Field: Line Three\"&&\n>                 git format-patch --stdout first | sed -e \"1d\"\n>         } | sed -e \"s/$/;/\" | tr \";\" \"\\\\015\">  patch1-crlf.eml\n\nCloser, but not there yet.  \"$/\" is still not defined.  Then, as a matter\nof style, '\\' is more readable than \"\\\\\" for representing a backslash.  So\nas long as we are shifting to '', we might as well do it everywhere in\nthat line - write it like this:\n\n} | sed -e 's/$/;/' | tr ';' '\\015' > patch1-crlf.eml\n\nand you should be set.\n\n-- \nDon't work too hard, make some time for fun as well!\n\nEric Blake             ebb9@byu.net\n"},{"id":"130124","messageId":"4B2C70ED.1020602@gmail.com","threadId":"21980","inReplyTo":"4B2C66D3.1070508@byu.net","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-12-19T06:21:33Z","receivedAt":"2009-12-19T06:21:33Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 12/18/2009 09:38 PM, Eric Blake wrote:\n> Closer, but not there yet.  \"$/\" is still not defined.  Then, as a matter\n> of style, '\\' is more readable than \"\\\\\" for representing a backslash.  So\n> as long as we are shifting to '', we might as well do it everywhere in\n> that line - write it like this:\n>\n> } | sed -e 's/$/;/' | tr ';' '\\015'>  patch1-crlf.eml\n>\n> and you should be set.\n\nAh, I think you missed that this stuff is inside single quotes already. \nI would love to just do what you suggest here.\n\nI'm a little confused because I see this in a test (am \n--committer-date-is-author-date) a ways down in the same file\n\n     git cat-file commit HEAD | sed -e \"/^$/q\">head1&&\n\n\nand following your reasoning that wouldn't be portable?\n\nEither way, I'll look for a better replacement character instead of \nsemi-colon.\n"},{"id":"130125","messageId":"4B2C7B9C.1030404@gmail.com","threadId":"21980","inReplyTo":"4B2C70ED.1020602@gmail.com","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-12-19T07:07:08Z","receivedAt":"2009-12-19T07:07:08Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"I found this in t0022\n\nsed -e \"s/\\$/\n^M/\" \"$TEST_DIRECTORY\"/t0022-crlf-rename.sh>elpmas&&\n\nso I'd like to use that if possible.\n"},{"id":"130127","messageId":"7vk4wjfm4s.fsf@alter.siamese.dyndns.org","threadId":"21980","inReplyTo":"4B2C7B9C.1030404@gmail.com","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-19T07:39:31Z","receivedAt":"2009-12-19T07:39:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> I found this in t0022\n>\n> sed -e \"s/\\$/\n> ^M/\" \"$TEST_DIRECTORY\"/t0022-crlf-rename.sh>elpmas&&\n>\n> so I'd like to use that if possible.\n\nThat needs fixing; I think we caught something similar from Shawn before\nit got in, primarily because the mail path corrupted the message and\nturned the literal CR into LF.\n"},{"id":"130129","messageId":"m2y6kzi7iw.fsf@igel.home","threadId":"21980","inReplyTo":"4B2C70ED.1020602@gmail.com","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2009-12-19T10:26:47Z","receivedAt":"2009-12-19T10:26:47Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> On 12/18/2009 09:38 PM, Eric Blake wrote:\n>> Closer, but not there yet.  \"$/\" is still not defined.  Then, as a matter\n>> of style, '\\' is more readable than \"\\\\\" for representing a backslash.  So\n>> as long as we are shifting to '', we might as well do it everywhere in\n>> that line - write it like this:\n>>\n>> } | sed -e 's/$/;/' | tr ';' '\\015'>  patch1-crlf.eml\n>>\n>> and you should be set.\n>\n> Ah, I think you missed that this stuff is inside single quotes already. I\n> would love to just do what you suggest here.\n\nYou can replace every use of ' by '\\''.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"130134","messageId":"4B2CBDD8.9000508@gmail.com","threadId":"21980","inReplyTo":"7vk4wjfm4s.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-12-19T11:49:44Z","receivedAt":"2009-12-19T11:49:44Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 12/18/2009 11:39 PM, Junio C Hamano wrote:\n> Stephen Boyd<bebarino@gmail.com>  writes:\n>    \n>> I found this in t0022\n>>\n>> sed -e \"s/\\$/\n>> ^M/\" \"$TEST_DIRECTORY\"/t0022-crlf-rename.sh>elpmas&&\n>>\n>> so I'd like to use that if possible.\n>>      \n> That needs fixing; I think we caught something similar from Shawn before\n> it got in, primarily because the mail path corrupted the message and\n> turned the literal CR into LF\n\nSorry it looks like my mailer turned the CR into a LF. That should all \nbe one line.\n\nAre you saying that t0022 needs fixing?\n"},{"id":"130870","messageId":"20100106073822.6117@nanako3.lavabit.com","threadId":"21980","inReplyTo":"1261172078-9174-1-git-send-email-bebarino@gmail.com","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2010-01-05T22:38:22Z","receivedAt":"2010-01-05T22:38:22Z","isPatch":false,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Junio, could you tell us what happened to this thread?\n\nAfter a lengthy discussion, nothing happened.\n"},{"id":"132326","messageId":"780e0a6b1001211051h762003f1i9e34f493cb5fd755@mail.gmail.com","threadId":"21980","inReplyTo":"20100106073822.6117@nanako3.lavabit.com","subject":"Re: [PATCHv2] am: fix patch format detection for Thunderbird \"Save As\" emails","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-01-21T18:51:31Z","receivedAt":"2010-01-21T18:51:31Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Tue, Jan 5, 2010 at 2:38 PM, Nanako Shiraishi <nanako3@lavabit.com> wrote:\n> Junio, could you tell us what happened to this thread?\n>\n> After a lengthy discussion, nothing happened.\n>\n\nSorry. I lost interest during the holidays and then went on a vacation\nafter. I've returned and will try and get back to it this weekend.\n"}]}