git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Øyvind A. Holm" <sunny@sunbase.org>
To: git@vger.kernel.org
Cc: sunny@sunbase.org
Subject: MIME problem when using git format-patch / git am
Date: Mon, 26 Apr 2010 01:35:49 +0200	[thread overview]
Message-ID: <20100425233549.GA8737@triton> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3903 bytes --]

I have a problem when using `git format-patch` and `git am` when there 
are 8-bit (i.e. UTF-8) characters in the log message from line three and 
below. I have attached a script (`runme.sh`) for reproducing this. It is 
also available from <http://gist.github.com/378785> in case the 
attachment is mangled.

My output is this:

    $ ./runme.sh
    LANG=en_GB.UTF-8
    LANGUAGE=en_GB.UTF-8
    LC_COLLATE=C
    LC_CTYPE=en_GB.utf8

    Initialized empty Git repository in /home/sunny/src/git/til_git-lista/dir/.git/
    [master (root-commit) 2755112] Initial commit

    ======== Create commits
    [master 9ab743b] First commit without 8-bit chars
     1 files changed, 1 insertions(+), 0 deletions(-)
     create mode 100644 foo.txt
    [master dd5bdf2] Second commit with © in first line of logmsg
     1 files changed, 1 insertions(+), 0 deletions(-)
    [master 82a445a] Third commit with no 8-bit in first line but €uro further down
     1 files changed, 1 insertions(+), 0 deletions(-)
    [master 42881f1] Fourth commit with © in first line again
     1 files changed, 1 insertions(+), 0 deletions(-)

    ======== git format-patch firstrev
    0001-First-commit-without-8-bit-chars.patch
    0002-Second-commit-with-in-first-line-of-logmsg.patch
    0003-Third-commit-with-no-8-bit-in-first-line.patch
    0004-Fourth-commit-with-in-first-line-again.patch

    ======== Create new, empty branch and apply patches
    Switched to a new branch 'patches'
    Applying: First commit without 8-bit chars
    Applying: Second commit with © in first line of logmsg
    Applying: =?UTF-8?q?Third=20commit=20with=20no=208-bit=20in=20first=20line
    Applying: Fourth commit with © in first line again

    ======== git log
    commit 58bcf14aee4b17152ae1f8bd40a24141e93897ec
    Author: Øyvind A. Holm <sunny@sunbase.org>
    Date:   0 seconds ago

        Fourth commit with © in first line again

    commit 56e98bd6b161510687abd658728f92b3bd85baf1
    Author: Øyvind A. Holm <sunny@sunbase.org>
    Date:   1 seconds ago

        =?UTF-8?q?Third=20commit=20with=20no=208-bit=20in=20first=20line

        =20but=20=E2=82=ACuro=20further=20down?=
        MIME-Version: 1.0
        Content-Type: text/plain; charset=UTF-8
        Content-Transfer-Encoding: 8bit

    commit 55de5c9008c53a388439f0a0cdb2043d9a36ba6b
    Author: Øyvind A. Holm <sunny@sunbase.org>
    Date:   1 seconds ago

        Second commit with © in first line of logmsg

    commit af6bf42a07208bc31d537a50562a5997f02e58cb
    Author: Øyvind A. Holm <sunny@sunbase.org>
    Date:   1 seconds ago

        First commit without 8-bit chars

    commit 2755112f613687510803e45868751e7b85e3cd1e
    Author: Øyvind A. Holm <sunny@sunbase.org>
    Date:   1 seconds ago

        Initial commit
    $

If it’s messed up (wordwrap and such), it’s also available from 
<http://gist.github.com/raw/378785/output.txt>.

In this case the log message of the third commit (56e98) is unreadable. 
This only happens when there are characters above U+0080 in the log 
message, but not in the first line, as that ends up as the subject. Yes, 
I’ve also tried to remove the "Ø" from the author name, with similar 
results.

I’m using `git format-patch`/`git am` as an easy way to import/export 
commits between repositories and directories, and I’m thinking that 
these commands are probably not intended for that kind of use. Are there 
any other method or some magic command line options that makes this 
possible, or is this a bug?

    +-| Øyvind A. Holm <sunny@sunbase.org> - N 60.39548° E 5.31735° |-+
    | OpenPGP: 0xFB0CBEE894A506E5 - http://www.sunbase.org/pubkey.asc |
    | Fingerprint: A006 05D6 E676 B319 55E2  E77E FB0C BEE8 94A5 06E5 |
    +------------| 1f818370-50c1-11df-ae95-90e6ba3022ac |-------------+

[-- Attachment #1.2: runme.sh --]
[-- Type: application/x-sh, Size: 941 bytes --]

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

             reply	other threads:[~2010-04-25 23:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-25 23:35 Øyvind A. Holm [this message]
2010-04-26  1:49 ` MIME problem when using git format-patch / git am Jonathan Nieder
2010-04-26  8:50   ` Peter Krefting
2010-04-27 15:32     ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100425233549.GA8737@triton \
    --to=sunny@sunbase.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).