On Thu, 24 Feb 2022 at 14:30, Tao Liu <ltao(a)redhat.com> wrote:
>
> Hi Philipp and Coiby,
>
> On Mon, Feb 21, 2022 at 11:39 PM Philipp Rudo <prudo(a)redhat.com> wrote:
> >
> > Hi Tao,
> >
> > On Mon, 21 Feb 2022 18:03:05 +0800
> > Tao Liu <ltao(a)redhat.com> wrote:
> >
> > > Hi Coiby,
> > >
> > > Thanks for the info!
> >
> > it's a real pain, that the mail server changes the patches...
> >
>
> I just talked to Dave, he told me the way he used to download the patches,
> which worked fine to me.
>
> Previously I downloaded the patches through mutt, tagging the patches
> within the patch set, and shift+c to copy the mail to my local drive, then
> git am to apply the mail in my source tree.
>
> Now I use alt+shift+c, which will decode the base64 patch content within
> mutt first then copy the mail to local drive, then git am as before, guess what,
> the ^M chars disappear after git am the mail.
>
> So it seems not a mail server issue, rather than mutt or git am issue.
Hi Tao,
Actually mutt correctly decode the base64 content, and then it removed
the ^M before saving the mail to files :)
So our assumption is wrong, ^M is still added on server part
Please see below kde bz discussion:
https://bugs.kde.org/show_bug.cgi?id=55624
Someone mentioned below:
6.8. Base64 Content-Transfer-Encoding
...
Care must be taken to use the proper octets for line breaks if base64
encoding is applied directly to text material that has not been
converted to canonical form. In particular, text line breaks must be
converted into CRLF sequences prior to base64 encoding. The
important thing to note is that this may be done directly by the
encoder rather than in a prior canonicalization step in some
implementations.
...
So this is required by base64 encoding :(
Anyway the mutt decode-copy just works for me.
Thanks for providing this clue! After doing more investigation, I think
the problem is "git am" as an email client doesn't convert these CRLF
sequences after doing base64 decoding. This issue seems to have been
there for a few years,
1. "git-am doesn't strip CRLF line endings when the mbox is base64-encoded -
George Dunlap"
)
2. "1469098 – git am doesn't apply for base64 encoded mail"
)
It seems git developer somehow doesn't want to fix this easy problem.
--
Best regards,
Coiby