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

Re: Problems with format-patch UTF-8 and a missing second empty line

From
Alexey Shumkin <zapped@mail.ru>
Date
Sep 15, 2011, 20:05 UTC
Message-ID
<20110916000515.1dfc5665@zappedws>
In-Reply-To
<20110915185033.GA17016@sigill.intra.peff.net>
Show 16 quoted lines
> > 
> > I reproduced this bug with the latest git (v1.7.6.3)
> > It seems to me this is not the "git format-patch" bug
> > but "git am"'s one. (But it is only the supposition)
> 
> Can you be more specific about what you tested? Running Ingo's snippet
> with a more recent git produces:
> 
>   Subject: [PATCH] =?UTF-8?q?=C3=84=C3=96=C3=9C=20=C3=84=C3=96=C3=9C?=
> 
> which is right (and "git am", new or old, will apply it just fine).
> 
> But there may be a different, related bug lurking somewhere.
> 
> -Peff
> 
this is my steps (log from terminal)

$ mkdir git-format-patch Initialized empty Git repository in /home/Alex/tmp/git-format-patch/.git/

$ cd git-format-patch
$ echo file content > file

$ git add -vf file add 'file'

$ git commit -a -m 'коммит: строка-1
> коммит: строка-2'
[master (root-commit) 7ede929] коммит: строка-1 коммит: строка-2
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file
$ git log
commit 7ede9291cf2d160721bcd8362d8d0f6c6e28cf29
Author: Alexey Shumkin <zapped@mail.ru>
Date:   Thu Sep 15 23:18:26 2011 +0400
    коммит: строка-1
    коммит: строка-2

$ git format-patch --root HEAD 0001-1.patch

$ cat 0001-1.patch 
From 7ede9291cf2d160721bcd8362d8d0f6c6e28cf29 Mon Sep 17 00:00:00 2001
From: Alexey Shumkin <zapped@mail.ru>
Date: Thu, 15 Sep 2011 23:18:26 +0400
Subject: [PATCH]
=?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1=82:=20=D1=81=D1?=
=?UTF-8?q?=82=D1=80=D0=BE=D0=BA=D0=B0-1=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1?=
=?UTF-8?q?=82:=20=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B0-2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 file |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file
diff --git a/file b/file
new file mode 100644
index 0000000..dd59d09
--- /dev/null
+++ b/file
@@ -0,0 +1 @@
+file content
-- 
1.7.6.3.4.gf71f

$ git init ../git-format-patch-am
Initialized empty Git repository
in /home/Alex/tmp/git-format-patch-am/.git/

$ cd ../git-format-patch-am

$ git am < ../git-format-patch/0001-1.patch
Applying: коммит: строка-1 коммит: строка-2
applying to an empty history

$ git log
commit 9856238e06d4ca8faeefc48e5c80e8ef7bd34195
Author: Alexey Shumkin <zapped@mail.ru>
Date:   Thu Sep 15 23:18:26 2011 +0400

    коммит: строка-1 коммит: строка-2

$ git --version
git version 1.7.6.3.4.gf71f



But as you said
>>This is by design. Git commit messages are intended to have a
>>single-line subject, followed by a blank line, followed by more
>>elaboration

and solved with "-k" for both "format-patch" and "am" commands
Previous: Jeff KingNext: Jeff King
Message 5 of 6 in “Problems with format-patch UTF-8 and a missing second empty line”
  1. Ingo RuhnkeSep 15, 2011
  2. Jeff KingSep 15, 2011
  3. Jeff KingSep 15, 2011
  4. Jeff KingSep 15, 2011
  5. Alexey ShumkinSep 15, 2011
  6. Jeff KingSep 15, 2011

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.