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

Re: git-mailinfo munges the patch?

From
Junio C Hamano <junkio@cox.net>
Date
Mar 29, 2007, 21:24 UTC
Message-ID
<7vejn73fqg.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070329205357.GF11029@redhat.com>
Don Zickus <dzickus@redhat.com> writes:
Show 10 quoted lines
> On Thu, Mar 29, 2007 at 01:18:51PM -0700, Junio C Hamano wrote:
>> I noticed that the new mailinfo when splitting a message into
>> cover letter and the patch text seems to munge the patch text,
>> applying the same "if content-type is not there then assume
>> latin-1 and recode to utf-8" logic that is applied to the commit
>> log message.  That munging should not be done to the patch text,
>> and it appears the current code botches it.
>
> Ok.  I see what you are saying with the old code.  Sorry about that.  Do
> you have a sample file that I can play with to test my fix?
Attached are two files.

The first one is to be split with git-mailsplit and then processed with git-mailinfo; I just tried to make sure what I expect to see as the output is given by 1.5.0 but not with the current 'master'.

The second one is a bundle of the repository the test data comes from. You could use it like this:

	$ mkdir foo && cd foo && git init
        $ git pull ../sample.bdl master

The repository has one branch, 'master', with two commits on it. The first one creates an empty file 'a', and the second one adds a line to the file, which has a Spanish "tilde on top of N" in it, and the contents of the file is encoded in ISO 8859-1.

The commit message of the second one is plain ascii but it could be in UTF-8.

The point is that patch can have payload from different files that are possibly in different encodings, so shoud really be treated as binary data without mangling.

Thanks.
Previous: Don ZickusNext: Don Zickus
Message 5 of 6 in “git-mailinfo munges the patch?”
  1. Junio C HamanoMar 29, 2007
  2. Don ZickusMar 29, 2007
  3. Linus TorvaldsMar 29, 2007
  4. Don ZickusMar 29, 2007
  5. Junio C HamanoMar 29, 2007
  6. Don ZickusMar 29, 2007

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.