git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Ingo Ruhnke <grumbel@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Problems with format-patch UTF-8 and a missing second empty line
Date: Thu, 15 Sep 2011 15:01:32 -0400	[thread overview]
Message-ID: <20110915190132.GA17027@sigill.intra.peff.net> (raw)
In-Reply-To: <CAHz1FYgPuMHLC+f2mFqD73=NGXQSStRPDOsiCy-HtaWKbHu7NQ@mail.gmail.com>

On Thu, Sep 15, 2011 at 11:45:15AM +0200, Ingo Ruhnke wrote:

> Creating a patch of a commit including UTF-8 and no empty second line,
> like this:

I already responded about the bug with utf8-encoded subjects, but let me
address the second half of your mail, too:

> Here the newline between ABC\nABC gets stripped out and replaced with
> a space when transferring the commit with format-patch from one
> repository to another.

This is by design. Git commit messages are intended to have a
single-line subject, followed by a blank line, followed by more
elaboration. A multi-line subject is treated as a single line that has
been line-broken, and is subject to being reflowed onto a single line.
This is done to help with commits imported from other version control
systems which don't follow this pattern (the other option is truncating
the subject and putting the other lines into the "body", but that often
ends up quite unreadable).

If you really want to retain the newlines across "format-patch | am",
use the "-k" option of both to preserve the subject (I don't recall the
details, but I think you need a more recent version of git for
format-patch to correctly encode this, but "am" can be from any
version).

> Another small issue is that the filename of the patch will strip out
> any UTF-8 characters, Thus a commit message of "123Äöü456" will result
> in "0001-123-456.patch".

Yes, it's an attempt to strip out characters that some filesystems might
not support well. We could probably enable high-bit characters with a
config option (maybe even just using core.quotepath).

-Peff

      parent reply	other threads:[~2011-09-15 19:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15  9:45 Problems with format-patch UTF-8 and a missing second empty line Ingo Ruhnke
2011-09-15 15:17 ` Jeff King
     [not found]   ` <20110915224456.14410ed8@zappedws>
2011-09-15 18:50     ` Jeff King
2011-09-15 20:05       ` Alexey Shumkin
2011-09-15 20:33         ` Jeff King
2011-09-15 19:01 ` Jeff King [this message]

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=20110915190132.GA17027@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=grumbel@gmail.com \
    /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).