{"thread":{"id":"7476","subject":"git-mailinfo munges the patch?","startedAt":"2007-03-29T20:18:51Z","lastAt":"2007-03-29T21:53:25Z","messageCount":6,"participants":["Junio C Hamano","Don Zickus","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"38345","messageId":"7v1wj74xck.fsf@assigned-by-dhcp.cox.net","threadId":"7476","inReplyTo":null,"subject":"git-mailinfo munges the patch?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-29T20:18:51Z","receivedAt":"2007-03-29T20:18:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I noticed that the new mailinfo when splitting a message into\ncover letter and the patch text seems to munge the patch text,\napplying the same \"if content-type is not there then assume\nlatin-1 and recode to utf-8\" logic that is applied to the commit\nlog message.  That munging should not be done to the patch text,\nand it appears the current code botches it.\n\nI am a bit too busy with day job today and haven't had a chance\nto look into this problem fully, but 1.5.0.3 does not seem to\nhave this problem but post 87ab7992 mailinfo is problematic.\n"},{"id":"38350","messageId":"20070329205357.GF11029@redhat.com","threadId":"7476","inReplyTo":"7v1wj74xck.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-mailinfo munges the patch?","fromName":"Don Zickus","fromEmail":"dzickus@redhat.com","sentAt":"2007-03-29T20:53:57Z","receivedAt":"2007-03-29T20:53:57Z","isPatch":false,"sender":{"key":"dzickus@redhat.com","avatar":null},"body":"On Thu, Mar 29, 2007 at 01:18:51PM -0700, Junio C Hamano wrote:\n> I noticed that the new mailinfo when splitting a message into\n> cover letter and the patch text seems to munge the patch text,\n> applying the same \"if content-type is not there then assume\n> latin-1 and recode to utf-8\" logic that is applied to the commit\n> log message.  That munging should not be done to the patch text,\n> and it appears the current code botches it.\n\nOk.  I see what you are saying with the old code.  Sorry about that.  Do\nyou have a sample file that I can play with to test my fix?\n\nCheers,\nDon\n"},{"id":"38353","messageId":"Pine.LNX.4.64.0703291417250.6730@woody.linux-foundation.org","threadId":"7476","inReplyTo":"20070329205357.GF11029@redhat.com","subject":"Re: git-mailinfo munges the patch?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-03-29T21:19:26Z","receivedAt":"2007-03-29T21:19:26Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 29 Mar 2007, Don Zickus wrote:\n> \n> Ok.  I see what you are saying with the old code.  Sorry about that.  Do\n> you have a sample file that I can play with to test my fix?\n\nOn that note - here's an unrelated simple case that the old mailinfo got \nright, but the new one seems to screw up: multiple Subject: lines.\n\nThe old one would make later Subject: lines override the earlier ones, and \nI depended on that when I fix up peoples emails to me manually (you \nwouldn't believe how bad explanations or subject lines people use for \nperfectly good patches ;)\n\nThe current mailinfo seems to just take the first one. \n\n\t\tLinus\n"},{"id":"38354","messageId":"7vejn73fqg.fsf@assigned-by-dhcp.cox.net","threadId":"7476","inReplyTo":"20070329205357.GF11029@redhat.com","subject":"Re: git-mailinfo munges the patch?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-29T21:24:39Z","receivedAt":"2007-03-29T21:24:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Don Zickus <dzickus@redhat.com> writes:\n\n> On Thu, Mar 29, 2007 at 01:18:51PM -0700, Junio C Hamano wrote:\n>> I noticed that the new mailinfo when splitting a message into\n>> cover letter and the patch text seems to munge the patch text,\n>> applying the same \"if content-type is not there then assume\n>> latin-1 and recode to utf-8\" logic that is applied to the commit\n>> log message.  That munging should not be done to the patch text,\n>> and it appears the current code botches it.\n>\n> Ok.  I see what you are saying with the old code.  Sorry about that.  Do\n> you have a sample file that I can play with to test my fix?\n\nAttached are two files.\n\nThe first one is to be split with git-mailsplit and then\nprocessed with git-mailinfo; I just tried to make sure what I\nexpect to see as the output is given by 1.5.0 but not with the\ncurrent 'master'.\n\nThe second one is a bundle of the repository the test data comes\nfrom.  You could use it like this:\n\n\t$ mkdir foo && cd foo && git init\n        $ git pull ../sample.bdl master\n\nThe repository has one branch, 'master', with two commits on\nit.  The first one creates an empty file 'a', and the second one\nadds a line to the file, which has a Spanish \"tilde on top of N\"\nin it, and the contents of the file is encoded in ISO 8859-1.\n\nThe commit message of the second one is plain ascii but it could\nbe in UTF-8.\n\nThe point is that patch can have payload from different files\nthat are possibly in different encodings, so shoud really be\ntreated as binary data without mangling.\n\nThanks.\n\n"},{"id":"38357","messageId":"20070329215248.GG11029@redhat.com","threadId":"7476","inReplyTo":"Pine.LNX.4.64.0703291417250.6730@woody.linux-foundation.org","subject":"Re: git-mailinfo munges the patch?","fromName":"Don Zickus","fromEmail":"dzickus@redhat.com","sentAt":"2007-03-29T21:52:48Z","receivedAt":"2007-03-29T21:52:48Z","isPatch":false,"sender":{"key":"dzickus@redhat.com","avatar":null},"body":"On Thu, Mar 29, 2007 at 02:19:26PM -0700, Linus Torvalds wrote:\n> \n> \n> On Thu, 29 Mar 2007, Don Zickus wrote:\n> > \n> > Ok.  I see what you are saying with the old code.  Sorry about that.  Do\n> > you have a sample file that I can play with to test my fix?\n> \n> On that note - here's an unrelated simple case that the old mailinfo got \n> right, but the new one seems to screw up: multiple Subject: lines.\n> \n> The old one would make later Subject: lines override the earlier ones, and \n> I depended on that when I fix up peoples emails to me manually (you \n> wouldn't believe how bad explanations or subject lines people use for \n> perfectly good patches ;)\n\nI see what happened.  The old code allowed rewriting of the mail headers\nbut blocked rewriting of the inbody headers.  For some reason I thought it\nwas by accident that the mail headers were allow to be rewritten.  Oops.\n:(\n\nI wrote the code to have both header types block rewriting.  I'll change\nthat.  \n\nCheers,\nDon\n"},{"id":"38358","messageId":"20070329215325.GH11029@redhat.com","threadId":"7476","inReplyTo":"7vejn73fqg.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-mailinfo munges the patch?","fromName":"Don Zickus","fromEmail":"dzickus@redhat.com","sentAt":"2007-03-29T21:53:25Z","receivedAt":"2007-03-29T21:53:25Z","isPatch":false,"sender":{"key":"dzickus@redhat.com","avatar":null},"body":"On Thu, Mar 29, 2007 at 02:24:39PM -0700, Junio C Hamano wrote:\n> Don Zickus <dzickus@redhat.com> writes:\n> \n> > On Thu, Mar 29, 2007 at 01:18:51PM -0700, Junio C Hamano wrote:\n> >> I noticed that the new mailinfo when splitting a message into\n> >> cover letter and the patch text seems to munge the patch text,\n> >> applying the same \"if content-type is not there then assume\n> >> latin-1 and recode to utf-8\" logic that is applied to the commit\n> >> log message.  That munging should not be done to the patch text,\n> >> and it appears the current code botches it.\n> >\n> > Ok.  I see what you are saying with the old code.  Sorry about that.  Do\n> > you have a sample file that I can play with to test my fix?\n> \n> Attached are two files.\n\nThanks.  I'll play with them later tonight.\n\nCheers,\nDon\n"}]}