Re: git format-patch escaping issues in the patch format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 04, 2024 at 08:24:14PM +0100, Christoph Anton Mitterer wrote:

> 2. The format-patch for that looks already suspicious:
>    - The From line is not escaped (as some variants of mbox would do,
>      some properly some, causing corruption by the escaping with >
>      itself).

As you note, the mbox format is not well defined. :) The variant with
">"-quoting of "From" lines is often called "mboxrd", and you can get it
with the "--format=mboxrd" option.

>    - What the format may think of as a separator after the commit
>      message (namely the ---) cannot be used as that either, as a ---
>      in the commit message is again not escaped.

For this, though, I don't think there is any solution. The receiving
side of "git am" does not know of any unquoting mechanism. So even if
you wanted to quote it, you could not get a lossless transmission of the
commit message.

This does occasionally cause confusion. Especially if you include an
unindented diff in your commit message, which similarly (and
intentionally) triggers the "---" detection. But I think it's one of
those things that just doesn't come up often enough for anybody to have
cared about trying to address.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux