From owner-freebsd-hackers@freebsd.org Wed Mar 28 11:43:26 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1DEFF51E0A for ; Wed, 28 Mar 2018 11:43:25 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2a00:14b0:4200:32e0::1ea]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gilb.zs64.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2128475A for ; Wed, 28 Mar 2018 11:43:25 +0000 (UTC) (envelope-from stb@lassitu.de) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id 3C44615787A; Wed, 28 Mar 2018 11:43:16 +0000 (UTC) From: Stefan Bethke Message-Id: <341CBD5C-89AF-4EA5-AD06-A43D267440ED@lassitu.de> Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Bugzilla converts patch to CRLF line endings? Date: Wed, 28 Mar 2018 13:43:14 +0200 In-Reply-To: <20180327194155.GA93992@bluezbox.com> Cc: freebsd-hackers@FreeBSD.org To: Oleksandr Tymoshenko References: <20180327194155.GA93992@bluezbox.com> X-Mailer: Apple Mail (2.3273) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Mar 2018 11:43:26 -0000 > Am 27.03.2018 um 21:41 schrieb Oleksandr Tymoshenko = : >=20 > Stefan Bethke (stb@lassitu.de) wrote: >> Hey, >>=20 >> I=E2=80=99ve submitted patched for the ports I maintain by = copy/pasting the svn diff output into the Bugzilla attachment form for a = long time. The committer working on = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D226941 noticed that = the patch apparently has CRLF line endings, making it hard(er) to apply = it properly. >>=20 >> Working on a Mac with Terminal and Safari, I have not have noticed = any such behaviour. When I copy/paste from Bugzilla into Terminal, = everything works just fine, so I can do =E2=80=9Ecd /usr/ports/cat/port; = patch -p0=E2=80=9C then paste and ^D. >>=20 >> When I download the attachment from the =E2=80=9Eraw=E2=80=9C = attachment link (in my example = https://bz-attachments.freebsd.org/attachment.cgi?id=3D191852) with curl = or wget, I do get to see CR-LF. >>=20 >> Where does that happen? And is that a bug or a feature? >=20 > I think it's a standard: https://stackoverflow.com/a/14217315 > Looks like browser is supposed to convert newlines in input field > to CR LF. I just tried it on our test instance \r\n-s are part > of a request, not added later. Bugzilla doesn't perfomr any > transformation of copy-pasted attachment text and saves it as-is. That's an unfortunate feature of Bugzilla then, considering that it = offers users to copy/paste patches into a textarea field, and = subsequently allows users to download the patch again, with the line = endings unmodified from the transport encoding. Interestingly, it is possible to download a patch file with correct line = endings by using the correct link. If you follow the link with the file = description as it's name, you get the data as submitted, with the wrong = line endings: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D191852= If you click on the "Diff" link, then download the "Raw Unified" link, = you'll get a file with correct line endings: = https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D191852&action=3Ddiff= &collapsed=3D&headers=3D1&format=3Draw = (This only works if the attachment has been marked as a patch.) Would it be a good idea to add instructions to either the attachment = upload or download page to explain about the line endings situation? Stefan --=20 Stefan Bethke Fon +49 151 14070811