From: Teemu Likonen <tlikonen@iki•fi>
To: Jeff King <peff@peff•net>
Cc: Junio C Hamano <gitster@pobox•com>, git@vger•kernel.org
Subject: Re: "add -p" + filenames with UTF-8 multibyte characters = "No changes"
Date: Mon, 16 Feb 2009 07:13:23 +0200 [thread overview]
Message-ID: <87ljs7ynf0.fsf@iki.fi> (raw)
In-Reply-To: <20090216033634.GA12461@coredump.intra.peff.net> (Jeff King's message of "Sun\, 15 Feb 2009 22\:36\:34 -0500")
On 2009-02-15 22:36 (-0500), Jeff King wrote:
> I am not opposed to setting this as a default, but I think there may
> be some encoding issues to be dealt with. At the very least,
> format-patch generates messages without a content-type header. E.g.,:
> But what is the right encoding to specify? We can guess that it is
> whatever the commit message is in (defaulting to utf-8). It is by no
> means correct, but it would probably work pretty well in practice.
I have a small script which adds/rewrites MIME headers. It defaults to
UTF-8/8bit:
#!/bin/sh
charset="${1:-UTF-8}"
encoding="${2:-8bit}"
formail -I "MIME-Version: 1.0" \
-I "Content-Type: text/plain; charset=$charset" \
-I "Content-Transfer-Encoding: $encoding" \
-s
I have used the script this way:
git format-patch --stdout [...] | add-mime-headers | \
formail -s sh -c 'cat >$FILENO.patch'
It may be difficult and unreliable to try to detect the encoding of file
content so maybe "git format-patch" could be taught an option like
"--charset=<charset>". (And perhaps also a configuration variable.) That
would just write MIME headers (charset) as the user wishes.
prev parent reply other threads:[~2009-02-16 5:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-15 18:40 "add -p" + filenames with UTF-8 multibyte characters = "No changes" Antonio García Domínguez
2009-02-15 18:59 ` Teemu Likonen
[not found] ` <2b8265360902151100n2eca0182odf9543c1dd8a7f98@mail.gmail.com>
2009-02-15 19:11 ` Teemu Likonen
2009-02-16 3:36 ` Jeff King
2009-02-16 4:00 ` Junio C Hamano
2009-02-17 7:02 ` [PATCH] git-add -i/-p: learn to unwrap C-quoted paths Junio C Hamano
2009-02-17 8:09 ` Teemu Likonen
2009-02-16 5:13 ` Teemu Likonen [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=87ljs7ynf0.fsf@iki.fi \
--to=tlikonen@iki$(echo .)fi \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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