From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5C30B2119A44F for ; Mon, 17 Dec 2018 01:34:44 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF3F67AE81; Mon, 17 Dec 2018 09:34:43 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-46.rdu2.redhat.com [10.10.120.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06573190C1; Mon, 17 Dec 2018 09:34:41 +0000 (UTC) To: "Jin, Eric" , Supreeth Venkatesh , Leif Lindholm , Andrew Fish , "Kinney, Michael D" Cc: "edk2-devel@lists.01.org" References: <20181212033214.10456-1-eric.jin@intel.com> <31cc8b433744850df7d65f73d3f2a6aa7840e71b.camel@arm.com> <20181214105917.qaplwp3vtspieig7@bivouac.eciton.net> <359acbc9-1e0f-722d-0096-67d77ab3c6c0@redhat.com> <7e7bee9361d2c1f2b38dc7944e82ce64a6b4a0a1.camel@arm.com> From: Laszlo Ersek Message-ID: <7af16613-cc1b-e658-8a55-4f299f88c5d0@redhat.com> Date: Mon, 17 Dec 2018 10:34:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 17 Dec 2018 09:34:44 +0000 (UTC) Subject: Re: Line endings: Was "Re: [edk2-test][Patch] uefi-sct/SctPkg:Correct macro name style in HwErrRecVariable Test" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 09:34:45 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/15/18 04:59, Jin, Eric wrote: > Currently, the git am fail with " --ignore-space-change" switch on/off. It is better if we can solve it with "core.whitespace", "am.keepcr" and "core.autocrlf" in the meantime. > > Should all existing patches hold until the conversion done or the conversion is tried on the branch until it is validated? If you just want to apply a patch from the mailing list, while sticking with the current line endings (=CRLF), then please use the git settings described e.g. at: https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers#contrib-05 Note that applying an edk2[-*] patch from the mailing list with git-am might fail for some reasons even if your git settings are fine (as described above). (1) One is that the submitter might have messed up the patch, and added LF-terminated lines to a CRLF context. (2) Another is that, for a good while, "git-am" would reject "/dev/null\r\n" header lines -- /dev/null lines are used when a patch adds or removes a file --, and only accept "/dev/null\n" ones. This is a problem because "am.keepcr" is required for edk2 patches (for now), and that results in \r *not* being stripped from "/dev/null\r\n" either. In other words, without am.keepcr, the patch context wouldn't match, and with am.keepcr, git would reject /dev/null lines (i.e., patches that added or removed files). In order to remedy (2), I had submitted a trivial (one-liner) patch for the git project in the year 2014: https://public-inbox.org/git/1411434583-27692-1-git-send-email-lersek@redhat.com/ The patch was rejected. Thus I've had to carry it in my own personal git build, until quite recently, in order to more easily work with edk2 patches. Thankfully, the issue was finally fixed in the following two git.git commits: * 8bc172e5f298 ("apply: use starts_with() in gitdiff_verify_name()", 2017-07-01) * e454ad4becff ("apply: handle Subversion diffs with /dev/null gracefully", 2018-02-15) (In terms of git releases, this means v2.17.0.) ... If you asked me why my patch wasn't originally accepted, but was accepted from another contributor, approx. 3.5+ years later (such that the new commit message would even reference "git-for-windows", i.e. it'd target a use case that was *very similar* to mine), then my answer would be: because that's how open source works; your success depends on what mood you catch a maintainer in. -------- Anyway, regarding the conversion, for the long term: - All text files should first be converted to LF only. (With a series of commits.) - For people on Windows, they should set "core.autocrlf" in their local git configs. - "am.keepcr" should be cleared by everyone, in their respective git configs. - "core.whitespace" might need more tweaking, but it's less important. Thanks Laszlo