git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-format-patch does not encode lines starting with "From"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 28, 2021, 08:08 UTC
Message-ID
<87sg12wgen.fsf@evledraar.gmail.com>
In-Reply-To
<5oq2985q-o266-8p5o-n197-8nq8s6p83oon@vanv.qr>
On Sun, Jun 27 2021, Jan Engelhardt wrote:
Show 41 quoted lines
> Summary
> =======
>
> git-format-patch in 2.32.0 fails to quote/escape lines starting with
> "From ", and mbox readers conclude there is an empty mail.
>
>
> Observed
> ========
>
> $ git commit -m 'subject
>
> From ffffffffffffffffffffffffffffffffffffffff Mon Sep 17 00:00:00 2001
> with love.'
> $ git format-patch HEAD^!
> $ head 0001-subject.patch
> From d489071b4855a49b32e9b5ae5addd982d2ed8d7d Mon Sep 17 00:00:00 2001
> From: Jan Engelhardt <jengelh@inai.de>
> Date: Sun, 27 Jun 2021 20:04:20 +0200
> Subject: [PATCH] subject
>
> From ffffffffffffffffffffffffffffffffffffffff Mon Sep 17 00:00:00 2001
> with love.
>
> $ git reset --hard HEAD^
> $ git am -p0 0001-subject.patch
> Patch is empty.
> When you have resolved this problem, run "git am --continue".
>
>
> Expected to see
> ===============
>
> $ head 0001-subject.patch
> From d489071b4855a49b32e9b5ae5addd982d2ed8d7d Mon Sep 17 00:00:00 2001
> From: Jan Engelhardt <jengelh@inai.de>
> Date: Sun, 27 Jun 2021 20:04:20 +0200
> Subject: [PATCH] subject
>
>>From ffffffffffffffffffffffffffffffffffffffff Mon Sep 17 00:00:00 2001
> with love.

"git format-patch --pretty=mboxrd" and "git am --patch-format" should solve this issue for you.

Previous: Jan Engelhardt
Message 2 of 2 in “git-format-patch does not encode lines starting with "From"”
  1. Jan EngelhardtJun 27, 2021
  2. Ævar Arnfjörð BjarmasonJun 28, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.