* Quoted-printable support in git am
@ 2017-10-05 9:15 Mason
2017-10-05 9:30 ` Jeff King
0 siblings, 1 reply; 4+ messages in thread
From: Mason @ 2017-10-05 9:15 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jeff King
Hello everyone,
Recently, the SMTP server we use at work started mangling outgoing
messages, by converting them to quoted-printable, whatever their
original encoding (even 7-bit clean, pure ASCII).
This breaks patches I send to Linux mailing lists, because it changes
TAB to =09, EQUAL to =3D, TRAILING SPACE to =20 and also wraps long
lines using a "=" continuation.
It looks like 'git am' doesn't support decoding this mess.
(I tried git version 2.14.2)
$ git am ~/rc.patch
Applying: media: rc: Add driver for tango IR decoder
error: patch failed: drivers/media/rc/Kconfig:469
error: drivers/media/rc/Kconfig: patch does not apply
error: patch failed: drivers/media/rc/Makefile:44
error: drivers/media/rc/Makefile: patch does not apply
Patch failed at 0001 media: rc: Add driver for tango IR decoder
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Is there a magic option I should be passing to git am?
The patch header contains:
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
The drivers/media/rc/Kconfig:469 part is
--- a/drivers/media/rc/Kconfig
+++ b/drivers/media/rc/Kconfig
@@ -469,6 +469,11 @@ config IR_SIR
=09 To compile this driver as a module, choose M here: the module will
=09 be called sir-ir.
=20
+config IR_TANGO
+=09tristate "Sigma Designs SMP86xx IR decoder"
+=09depends on RC_CORE
+=09depends on ARCH_TANGO || COMPILE_TEST
+
config IR_ZX
=09tristate "ZTE ZX IR remote control"
=09depends on RC_CORE
Googling a bit...
https://stackoverflow.com/questions/6289001/git-am-format-patch-control-format-of-line-endings
https://public-inbox.org/git/24940e12-3f72-1ef0-0983-58523d8dec51@redhat.com/t/
Looks like it should work...
Maybe I hit some weird corner case?
Regards.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Quoted-printable support in git am
2017-10-05 9:15 Quoted-printable support in git am Mason
@ 2017-10-05 9:30 ` Jeff King
2017-10-05 9:43 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2017-10-05 9:30 UTC (permalink / raw)
To: Mason; +Cc: git, Junio C Hamano
On Thu, Oct 05, 2017 at 11:15:08AM +0200, Mason wrote:
> Is there a magic option I should be passing to git am?
No, it's supposed to work out of the box.
> The patch header contains:
>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> Content-Transfer-Encoding: quoted-printable
That looks right. Though I wouldn't be surprised if whatever generated
the "flowed" also screwed up patch whitespace.
> The drivers/media/rc/Kconfig:469 part is
>
> --- a/drivers/media/rc/Kconfig
> +++ b/drivers/media/rc/Kconfig
> @@ -469,6 +469,11 @@ config IR_SIR
> =09 To compile this driver as a module, choose M here: the module will
> =09 be called sir-ir.
> =20
> +config IR_TANGO
> +=09tristate "Sigma Designs SMP86xx IR decoder"
> +=09depends on RC_CORE
> +=09depends on ARCH_TANGO || COMPILE_TEST
> +
> config IR_ZX
> =09tristate "ZTE ZX IR remote control"
> =09depends on RC_CORE
After "git am" bails, what does .git/rebase-apply/patch look like?
It should have the quoted-printable bits decoded. If it doesn't, then we
need to figure out why the qp-decoding didn't kick in. It would help to
see the whole input mbox then.
If it does have the qp bits decoded, then I'd suspect that maybe there's
whitespace damage caused by the MUA.
-Peff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Quoted-printable support in git am
2017-10-05 9:30 ` Jeff King
@ 2017-10-05 9:43 ` Junio C Hamano
2017-10-05 11:58 ` Mason
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2017-10-05 9:43 UTC (permalink / raw)
To: Jeff King; +Cc: Mason, git
On Thu, Oct 5, 2017 at 6:30 PM, Jeff King <peff@peff.net> wrote:
>
>> The patch header contains:
>>
>> Content-Type: text/plain; charset=UTF-8; format=flowed
>> Content-Transfer-Encoding: quoted-printable
>
> That looks right. Though I wouldn't be surprised if whatever generated
> the "flowed" also screwed up patch whitespace.
> ...
> If it does have the qp bits decoded, then I'd suspect that maybe there's
> whitespace damage caused by the MUA.
I would be surprised if MUA that says format=flawed did _not_ mangle the patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Quoted-printable support in git am
2017-10-05 9:43 ` Junio C Hamano
@ 2017-10-05 11:58 ` Mason
0 siblings, 0 replies; 4+ messages in thread
From: Mason @ 2017-10-05 11:58 UTC (permalink / raw)
To: Junio C Hamano, Jeff King; +Cc: git
On 05/10/2017 11:43, Junio C Hamano wrote:
> On Thu, Oct 5, 2017 at 6:30 PM, Jeff King wrote:
>
>> Mason wrote:
>>
>>> The patch header contains:
>>>
>>> Content-Type: text/plain; charset=UTF-8; format=flowed
>>> Content-Transfer-Encoding: quoted-printable
>>
>> That looks right. Though I wouldn't be surprised if whatever generated
>> the "flowed" also screwed up patch whitespace.
>> ...
>> If it does have the qp bits decoded, then I'd suspect that maybe there's
>> whitespace damage caused by the MUA.
>
> I would be surprised if MUA that says format=flawed did _not_ mangle the patch.
format=flawed :-) Did you write that on purpose?
Anyway, it turns out that I had somehow managed to generate an invalid patch
(with a spurious leading space in the 3+3 context lines); the quoted-printable
mangling was, in fact, a red-herring. Doh!
Sorry for the noise.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-05 11:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05 9:15 Quoted-printable support in git am Mason
2017-10-05 9:30 ` Jeff King
2017-10-05 9:43 ` Junio C Hamano
2017-10-05 11:58 ` Mason
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).