All of lore.kernel.org
 help / color / mirror / Atom feed
* How do I make git-format-patch reject 8-bit encodings?
@ 2011-02-21 22:11 Timur Tabi
  2011-02-22  0:19 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Timur Tabi @ 2011-02-21 22:11 UTC (permalink / raw)
  To: git

Is there any way to get git-format-patch to refuse to create a patch that has
8-bit characters in it?  That is, if a given commit somehow has an 8-bit
character (e.g. utf-encoded), then I want git-format-patch to refuse to create a
patch for that commit.

Also, how can I do the same thing with git-send-email?  That is, if the patch
requires an 8-bit encoding, how do I get it to refuse to send the patch?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I make git-format-patch reject 8-bit encodings?
  2011-02-21 22:11 How do I make git-format-patch reject 8-bit encodings? Timur Tabi
@ 2011-02-22  0:19 ` Junio C Hamano
  2011-02-22  0:27   ` Tabi Timur-B04825
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2011-02-22  0:19 UTC (permalink / raw)
  To: Timur Tabi; +Cc: git

Timur Tabi <timur@freescale.com> writes:

> Is there any way to get git-format-patch to refuse to create a patch that has
> 8-bit characters in it?  That is, if a given commit somehow has an 8-bit
> character (e.g. utf-encoded), then I want git-format-patch to refuse to create a
> patch for that commit.
>
> Also, how can I do the same thing with git-send-email?  That is, if the patch
> requires an 8-bit encoding, how do I get it to refuse to send the patch?

Feels like an X-Y problem, but wouldn't it be an option to let
format-patch write into individual files, check these files and reject
ones that are not 8-bit clean, and then send the result out via
send-email?  You should be proofreading the format-patch output to catch
and fix typos before hading them to send-email anyway, so the above would
be the natural thing to do.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I make git-format-patch reject 8-bit encodings?
  2011-02-22  0:19 ` Junio C Hamano
@ 2011-02-22  0:27   ` Tabi Timur-B04825
  2011-02-22  7:33     ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Tabi Timur-B04825 @ 2011-02-22  0:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano wrote:
> Feels like an X-Y problem, but wouldn't it be an option to let
> format-patch write into individual files, check these files and reject
> ones that are not 8-bit clean, and then send the result out via
> send-email?  You should be proofreading the format-patch output to catch
> and fix typos before hading them to send-email anyway, so the above would
> be the natural thing to do.

The problem is that it appears that git-send-email is taking normal-looking patches and encoding them as base64, and I don't know about it until after the email is sent.  It also appears to be inconsistent.  I've seen some utf-8 patches emailed as normal text, and other patches emailed as base64.

I don't have any real problem with utf-8, but I want to prevent git-send-email from doing base64 encodings on its own.

-- 
Timur Tabi
Linux kernel developer

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I make git-format-patch reject 8-bit encodings?
  2011-02-22  0:27   ` Tabi Timur-B04825
@ 2011-02-22  7:33     ` Jeff King
  2011-02-22 14:49       ` Timur Tabi
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2011-02-22  7:33 UTC (permalink / raw)
  To: Tabi Timur-B04825; +Cc: Junio C Hamano, git

On Tue, Feb 22, 2011 at 12:27:19AM +0000, Tabi Timur-B04825 wrote:

> Junio C Hamano wrote:
> > Feels like an X-Y problem, but wouldn't it be an option to let
> > format-patch write into individual files, check these files and reject
> > ones that are not 8-bit clean, and then send the result out via
> > send-email?  You should be proofreading the format-patch output to catch
> > and fix typos before hading them to send-email anyway, so the above would
> > be the natural thing to do.
> 
> The problem is that it appears that git-send-email is taking
> normal-looking patches and encoding them as base64, and I don't know
> about it until after the email is sent.

Can you provide an example of a message that is base64-encoded? I didn't
think we base64-encoded anything in send-email (we do rfc2047-encode
8-bit header lines, but using quoted-printable). And looking through it,
I don't see any code to do so.

It's possible that I'm missing the code. Or that one of the underlying
modules is doing it for us. Or it's possible that one of the SMTP
servers in your route is doing it.

If you can send an example of original format-patch output that you fed
to git-send-email, and the resulting mail that was delivered, then we
can know more.

I have a suspicion it is the last one (some MTA doing it), because git
tends to generate messages with an 8bit transfer encoding. If we hit a
server that doesn't advertise support for 8BIT SMTP extensions, I
believe the sending MTA is required to encode (or bounce). That would
also account for the inconsistency you noted. It depends on the
recipient and the exact route of SMTP servers in the delivery.

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I make git-format-patch reject 8-bit encodings?
  2011-02-22  7:33     ` Jeff King
@ 2011-02-22 14:49       ` Timur Tabi
  0 siblings, 0 replies; 5+ messages in thread
From: Timur Tabi @ 2011-02-22 14:49 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, git

Jeff King wrote:
> Can you provide an example of a message that is base64-encoded? I didn't
> think we base64-encoded anything in send-email (we do rfc2047-encode
> 8-bit header lines, but using quoted-printable). And looking through it,
> I don't see any code to do so.

I can forward to you the original email that is base64-encoded, but I cannot
reproduce the problem.  Even when I take that patch, apply it with git-am and
recreate it with git-format-patch, when I sent that recreate patch with
git-send-email, it is not base64 encoded.

> It's possible that I'm missing the code. Or that one of the underlying
> modules is doing it for us. Or it's possible that one of the SMTP
> servers in your route is doing it.

It is possible that our mail server is doing it.  We recently migrated to the
"Microsoft cloud" email service, and we've experienced all sorts of odd problems
with mailing patches.

> If you can send an example of original format-patch output that you fed
> to git-send-email, and the resulting mail that was delivered, then we
> can know more.

I don't know if I can still get the original patch that was encoded.

> I have a suspicion it is the last one (some MTA doing it), because git
> tends to generate messages with an 8bit transfer encoding. If we hit a
> server that doesn't advertise support for 8BIT SMTP extensions, I
> believe the sending MTA is required to encode (or bounce). That would
> also account for the inconsistency you noted. It depends on the
> recipient and the exact route of SMTP servers in the delivery.

Ah, this might be a clue.  I will do more research and get back to you.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-22 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-21 22:11 How do I make git-format-patch reject 8-bit encodings? Timur Tabi
2011-02-22  0:19 ` Junio C Hamano
2011-02-22  0:27   ` Tabi Timur-B04825
2011-02-22  7:33     ` Jeff King
2011-02-22 14:49       ` Timur Tabi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.