{"thread":{"id":"46908","subject":"Quoted-printable support in git am","startedAt":"2017-10-05T09:15:27Z","lastAt":"2017-10-05T11:59:11Z","messageCount":4,"participants":["Mason","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"329734","messageId":"165c9648-e7f0-66de-b3b9-023c48c49d95@free.fr","threadId":"46908","inReplyTo":null,"subject":"Quoted-printable support in git am","fromName":"Mason","fromEmail":"slash.tmp@free.fr","sentAt":"2017-10-05T09:15:08Z","receivedAt":"2017-10-05T09:15:27Z","isPatch":false,"sender":{"key":"slash.tmp@free.fr","avatar":null},"body":"Hello everyone,\n\nRecently, the SMTP server we use at work started mangling outgoing\nmessages, by converting them to quoted-printable, whatever their\noriginal encoding (even 7-bit clean, pure ASCII).\n\nThis breaks patches I send to Linux mailing lists, because it changes\nTAB to =09, EQUAL to =3D, TRAILING SPACE to =20 and also wraps long\nlines using a \"=\" continuation.\n\nIt looks like 'git am' doesn't support decoding this mess.\n(I tried git version 2.14.2)\n\n$ git am ~/rc.patch\nApplying: media: rc: Add driver for tango IR decoder\nerror: patch failed: drivers/media/rc/Kconfig:469\nerror: drivers/media/rc/Kconfig: patch does not apply\nerror: patch failed: drivers/media/rc/Makefile:44\nerror: drivers/media/rc/Makefile: patch does not apply\nPatch failed at 0001 media: rc: Add driver for tango IR decoder\nThe copy of the patch that failed is found in: .git/rebase-apply/patch\nWhen you have resolved this problem, run \"git am --continue\".\nIf you prefer to skip this patch, run \"git am --skip\" instead.\nTo restore the original branch and stop patching, run \"git am --abort\".\n\nIs there a magic option I should be passing to git am?\n\n\nThe patch header contains:\n\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-Transfer-Encoding: quoted-printable\n\n\nThe drivers/media/rc/Kconfig:469 part is\n\n--- a/drivers/media/rc/Kconfig\n+++ b/drivers/media/rc/Kconfig\n@@ -469,6 +469,11 @@ config IR_SIR\n  =09   To compile this driver as a module, choose M here: the module will\n  =09   be called sir-ir.\n =20\n+config IR_TANGO\n+=09tristate \"Sigma Designs SMP86xx IR decoder\"\n+=09depends on RC_CORE\n+=09depends on ARCH_TANGO || COMPILE_TEST\n+\n  config IR_ZX\n  =09tristate \"ZTE ZX IR remote control\"\n  =09depends on RC_CORE\n\n\nGoogling a bit...\nhttps://stackoverflow.com/questions/6289001/git-am-format-patch-control-format-of-line-endings\nhttps://public-inbox.org/git/24940e12-3f72-1ef0-0983-58523d8dec51@redhat.com/t/\n\nLooks like it should work...\n\nMaybe I hit some weird corner case?\n\nRegards.\n"},{"id":"329735","messageId":"20171005093052.3uefgby6a57udoqy@sigill.intra.peff.net","threadId":"46908","inReplyTo":"165c9648-e7f0-66de-b3b9-023c48c49d95@free.fr","subject":"Re: Quoted-printable support in git am","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-10-05T09:30:53Z","receivedAt":"2017-10-05T09:31:00Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 05, 2017 at 11:15:08AM +0200, Mason wrote:\n\n> Is there a magic option I should be passing to git am?\n\nNo, it's supposed to work out of the box.\n\n> The patch header contains:\n> \n> Content-Type: text/plain; charset=UTF-8; format=flowed\n> Content-Transfer-Encoding: quoted-printable\n\nThat looks right. Though I wouldn't be surprised if whatever generated\nthe \"flowed\" also screwed up patch whitespace.\n\n> The drivers/media/rc/Kconfig:469 part is\n> \n> --- a/drivers/media/rc/Kconfig\n> +++ b/drivers/media/rc/Kconfig\n> @@ -469,6 +469,11 @@ config IR_SIR\n>   =09   To compile this driver as a module, choose M here: the module will\n>   =09   be called sir-ir.\n>  =20\n> +config IR_TANGO\n> +=09tristate \"Sigma Designs SMP86xx IR decoder\"\n> +=09depends on RC_CORE\n> +=09depends on ARCH_TANGO || COMPILE_TEST\n> +\n>   config IR_ZX\n>   =09tristate \"ZTE ZX IR remote control\"\n>   =09depends on RC_CORE\n\nAfter \"git am\" bails, what does .git/rebase-apply/patch look like?\n\nIt should have the quoted-printable bits decoded. If it doesn't, then we\nneed to figure out why the qp-decoding didn't kick in. It would help to\nsee the whole input mbox then.\n\nIf it does have the qp bits decoded, then I'd suspect that maybe there's\nwhitespace damage caused by the MUA.\n\n-Peff\n"},{"id":"329736","messageId":"CAPc5daX+N_Z6v-NxOb5cHh1V3Ctu7uQ+QFHzN9ATTQ22pVAfQw@mail.gmail.com","threadId":"46908","inReplyTo":"20171005093052.3uefgby6a57udoqy@sigill.intra.peff.net","subject":"Re: Quoted-printable support in git am","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-10-05T09:43:01Z","receivedAt":"2017-10-05T09:43:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"On Thu, Oct 5, 2017 at 6:30 PM, Jeff King <peff@peff.net> wrote:\n>\n>> The patch header contains:\n>>\n>> Content-Type: text/plain; charset=UTF-8; format=flowed\n>> Content-Transfer-Encoding: quoted-printable\n>\n> That looks right. Though I wouldn't be surprised if whatever generated\n> the \"flowed\" also screwed up patch whitespace.\n> ...\n> If it does have the qp bits decoded, then I'd suspect that maybe there's\n> whitespace damage caused by the MUA.\n\nI would be surprised if MUA that says format=flawed did _not_ mangle the patch.\n"},{"id":"329756","messageId":"683bd77f-ecf2-33e9-8f45-24545a2785eb@free.fr","threadId":"46908","inReplyTo":"CAPc5daX+N_Z6v-NxOb5cHh1V3Ctu7uQ+QFHzN9ATTQ22pVAfQw@mail.gmail.com","subject":"Re: Quoted-printable support in git am","fromName":"Mason","fromEmail":"slash.tmp@free.fr","sentAt":"2017-10-05T11:58:57Z","receivedAt":"2017-10-05T11:59:11Z","isPatch":false,"sender":{"key":"slash.tmp@free.fr","avatar":null},"body":"On 05/10/2017 11:43, Junio C Hamano wrote:\n\n> On Thu, Oct 5, 2017 at 6:30 PM, Jeff King wrote:\n> \n>> Mason wrote:\n>>\n>>> The patch header contains:\n>>>\n>>> Content-Type: text/plain; charset=UTF-8; format=flowed\n>>> Content-Transfer-Encoding: quoted-printable\n>>\n>> That looks right. Though I wouldn't be surprised if whatever generated\n>> the \"flowed\" also screwed up patch whitespace.\n>> ...\n>> If it does have the qp bits decoded, then I'd suspect that maybe there's\n>> whitespace damage caused by the MUA.\n> \n> I would be surprised if MUA that says format=flawed did _not_ mangle the patch.\n\nformat=flawed  :-) Did you write that on purpose?\n\nAnyway, it turns out that I had somehow managed to generate an invalid patch\n(with a spurious leading space in the 3+3 context lines); the quoted-printable\nmangling was, in fact, a red-herring. Doh!\n\nSorry for the noise.\n"}]}