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

2 messages from 2021-06-27 to 2021-06-28. Participants: Jan Engelhardt, Ævar Arnfjörð Bjarmason.
Thread: https://gitlist.dev/t/56014

## Jan Engelhardt, 2021-06-27 18:08

Subject: git-format-patch does not encode lines starting with "From"
Message-ID: <5oq2985q-o266-8p5o-n197-8nq8s6p83oon@vanv.qr>
URL: https://gitlist.dev/e/5oq2985q-o266-8p5o-n197-8nq8s6p83oon%40vanv.qr

```

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.

```

## Ævar Arnfjörð Bjarmason, 2021-06-28 08:08

Subject: Re: git-format-patch does not encode lines starting with "From"
Message-ID: <87sg12wgen.fsf@evledraar.gmail.com>
URL: https://gitlist.dev/e/87sg12wgen.fsf%40evledraar.gmail.com
In-Reply-To: <5oq2985q-o266-8p5o-n197-8nq8s6p83oon@vanv.qr>

```

On Sun, Jun 27 2021, Jan Engelhardt wrote:

> 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.

```
