* Re: [Fwd: [FORCEDETH]: Fix reversing the MAC address on suspend.]
[not found] ` <20080109.164149.264906319.davem@davemloft.net>
@ 2008-01-10 3:47 ` Linus Torvalds
2008-01-10 9:17 ` David Woodhouse
0 siblings, 1 reply; 2+ messages in thread
From: Linus Torvalds @ 2008-01-10 3:47 UTC (permalink / raw)
To: David Miller; +Cc: dwmw2, B.Steinbrink, Junio C Hamano, Git Mailing List
On Wed, 9 Jan 2008, David Miller wrote:
>
> > How do you generate those MSG_FILE/PATCH_FILE things? Using
> > "git-mailinfo"? Do you by any chance give it the "-n" flag to make it
> > *not* do the conversion to UTF8?
>
> I create them by hand in my editor.
Ok. Apparently you get them in latin1, and save them as such.
If you can make your editor/mail setup (I assume it's Gnu "bovine
excrement" Emacs, since you say that you use your editor for email) use
utf8 natively for saving any results, then all your problems should go
away.
That said, I suspect we could make git-commit just do the same thing that
git-am already does, namely if it's not given an explicit character set
for the input/output _and_ it's supposed to be in utf8, it could do the
"guess_charset()" thing on a per-line basis.
It's not perfect, but the reason git-am does that (through "git mailinfo")
is exactly the fact that it's very easy indeed to have mixed messages with
some parts in UTF-8 (the body, for example) and others *not* in utf-8 (eg
have headers in Latin1).
Doing the "check each line one at a time, see if it is already in UTF-8,
otherwise assume it's the traditional Latin1" is kind of hacky, but it's
probably better than just acceping a non-utf8 commit message and writing
random data.
For people who really want to use Latin1 (or any other non-utf8 model), we
already have a way to get the current behaviour, by forcing something like
[i18n]
commitencoding = binary
but we seem to have ended up with UTF-8 being the default encoding, so we
should probably just make sure that we do end up writing valid utf-8
unless some other explicit commit encoding has been set up.
So I think it's really your own fault for basically giving a latin1
message (and not using the tools that know how to convert emails correctly
from *many* different encodings).
But I *also* think that git probably should at least have warned you (I
think it does, if you use "git commit" rather than "git commit-tree), and
preferably have refused to write an invalid encoding or just converted
from what is the most common one (and even if I feel a bit bad about just
saying "latin1 is the default non-utf8 encoding", I think it makes sense
for historical reasons).
Linus
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Fwd: [FORCEDETH]: Fix reversing the MAC address on suspend.]
2008-01-10 3:47 ` [Fwd: [FORCEDETH]: Fix reversing the MAC address on suspend.] Linus Torvalds
@ 2008-01-10 9:17 ` David Woodhouse
0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2008-01-10 9:17 UTC (permalink / raw)
To: Linus Torvalds
Cc: David Miller, B.Steinbrink, Junio C Hamano, Git Mailing List
On Wed, 2008-01-09 at 19:47 -0800, Linus Torvalds wrote:
> If you can make your editor/mail setup (I assume it's Gnu "bovine
> excrement" Emacs, since you say that you use your editor for email) use
> utf8 natively for saving any results, then all your problems should go
> away.
Careful with that approach. You don't necessarily want to convert the
patch; only the author info and the comments. I think git-mailinfo does
the right thing.
--
dwmw2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-10 9:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1199902258.2978.93.camel@pmac.infradead.org>
[not found] ` <20080109.154431.128118336.davem@davemloft.net>
[not found] ` <alpine.LFD.1.00.0801091620450.3148@woody.linux-foundation.org>
[not found] ` <20080109.164149.264906319.davem@davemloft.net>
2008-01-10 3:47 ` [Fwd: [FORCEDETH]: Fix reversing the MAC address on suspend.] Linus Torvalds
2008-01-10 9:17 ` David Woodhouse
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).