From nobody Sun Apr 10 10:33:25 2022 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 780551A8B38B; Sun, 10 Apr 2022 10:33:35 +0000 (UTC) (envelope-from matthias.andree@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KbpHK3Yt5z4TNm; Sun, 10 Apr 2022 10:33:33 +0000 (UTC) (envelope-from matthias.andree@gmx.de) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1649586806; bh=CM0c/GT/0EWCC7O/GGGPqQ1v4O0EfqXNIWyqANvg0dc=; h=X-UI-Sender-Class:Date:From:Subject:To:Cc:References:In-Reply-To; b=dyrSr//vASNc2LvMWo3GkKFzylyKFuAYkYe6yi1z9q6XQ7/MGBzAgnQGzE2qAdxZ8 uvVzkGX1lw02teOCs37JM2x8bi2MyIecy9c1hsgnUH9NxrckgF9a1vCd//mCmJzfqx 3gvtgkQlt7ArELlbYUSQ00doFdWxf0sCFC2kMcDM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from mandree.no-ip.org ([217.224.113.192]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MPGW7-1nL8eJ0gFJ-00Pgga; Sun, 10 Apr 2022 12:33:26 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by ryzen.an3e.de (Postfix) with ESMTP id A7AB73A1662; Sun, 10 Apr 2022 12:33:25 +0200 (CEST) Message-ID: <9f6f6d16-8e2e-b91d-9ba1-b2cf13270020@gmx.de> Date: Sun, 10 Apr 2022 12:33:25 +0200 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 From: Matthias Andree Subject: Re: [RFC] patch's default backup behavior To: Kyle Evans , freebsd-arch@freebsd.org Cc: FreeBSD Hackers , ports-list freebsd References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:GYQRjAfLABsfhblmunEbXmgQ1/WzzWnOgrsmPNDsEuoUFyfJhon Mg7wZ6KaQjI+ebUiPSutspl86sCe1BlQDxZ42eVsOrRx1Mi/PVkK1aHFXQNrbnn9+SRHaw7 fJ6aloUvlhHONyM1v7Rk7NG5hjzkOQfmz6P1ZpIbbyj5EN9qtBF3wI0dnODKflXXCPDkK0f GuYaovRMRiv+rzGPDvI9Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:eVGW8CObohg=:Uq1hgOyTDjjqJwlFlihxaI qpXOMU/BqSpVOeiedRKo2gUFpOeL+/g0Pdrd1QYkFaSg6XHqcnT5KwI9AOVgY8u92wAR0kzAO ehPJ8J8slEbMjIblhdtWZ3/YzExg3FlxllokLW7cDWkmk5X7YH/YqvsiT8t1tG4GSzPdXzQ3t ySuDIlUko2sEy8qObDjGN0qnw7Hu8pOOBqo3EjVk0vQR+zr5Ops9I6+T/szYVQdBw2L5xo2c+ LBxd79EbfCr0mgxX2xX8BhKay3cjSZs5zgwKxkICrbqyOlEI8rpCpASZxEPdJNvqGCRA1plNI fmQ82xVv2xTeHod2BeFShSH3jIiYgwyIpUDckQTEw+fkUSDulMgzvroLCmduINSH7vUiysxGu YKMG1pLVEW08/X52n5OQ8r5ufV0Fcw41QOcAjjCIWl0vrWPajkk68guW5Vc43e6JKL59+gGkG zASJ6j1M5srXV3TRXT5DH4gYhkZHynnFqa4NORQZDeN2BOIFQ26F4hs0IspIg9+AAVccOSaOs onsiKldONmuMBMlpdmgtxTa8Bv4duZEWKXsu1HVeav8qUJIKlTHmfvhq8j8xx9zaTLxL8JFVG S3FcK+k05g9ihYLAAGlBjovuZqfZwe7MjNYAK9K31+/DWOSlV61hgaQ3p4GcYCOHs2hYkpBmA nadZ1mwgmJQjanSdQ4VI/BeqwWadQw/gr3R94ChdVbFNmbHuyvpIBYIAfkwU3DR2cE2FPDKlh 8EH0OAjOcV1yU71AKvT/1oY/rtw/PIuf9rVe3wo01VCVBs6JGPio5ljDR8je9+ap1o1Ax5C/B yquEZMt/DrnmnjWI8A7YjTNB/ADxEg7ur77X6gysCAWs85dAUmU4b/iwGHi7/wNST/DBHuTAm reiaA5Pb5AqU3g54StOHXj8EIHYn9/+lyNYhMD5At9jKtIVyj4zVY1DRhqmMp9SS9G9ZtIpa3 h7RaiYDbTxXqswNssYeW+7mydC3nCydp1ChByGbon5ww2prwcccX6vybNqM53duG/QxFhrIcI SU1j6V1vWpkBHN++Ijdz3LoIhqIOlxKV8FMx2eLvwm01dptBTrwx1L9nLl8cdJwwWoeVzUxsQ OU7lQhOGeqbuDI= X-Rspamd-Queue-Id: 4KbpHK3Yt5z4TNm X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b="dyrSr//v"; dmarc=pass (policy=none) header.from=gmx.de; spf=pass (mx1.freebsd.org: domain of matthias.andree@gmx.de designates 212.227.15.15 as permitted sender) smtp.mailfrom=matthias.andree@gmx.de X-Spamd-Result: default: False [-3.34 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmx.de]; R_SPF_ALLOW(-0.20)[+ip4:212.227.15.0/25]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmx.net:+]; DMARC_POLICY_ALLOW(-0.50)[gmx.de,none]; RCVD_IN_DNSWL_LOW(-0.10)[212.227.15.15:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmx.de]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[217.224.113.192:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.76)[0.756]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[gmx.net:dkim]; MLMMJ_DEST(0.00)[freebsd-hackers,freebsd-arch,freebsd-ports]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.15.15:from] X-ThisMailContainsUnwantedMimeParts: N [resending from hopefully subscribed address that it makes it to some of the lists] Am 09.04.22 um 05:25 schrieb Kyle Evans: > Hello! > > FreeBSD's patch follows historical patch(1) behavior w.r.t. backups, > where a backup is created for every file patched. > > I'd like to test the waters on switching this to the GNU behavior, > which feels a whole lot more reasonable. Notably, they'll only create > backup files if a mismatch was detected (presumably this means either > a hunk needed fuzz or a hunk outright failed). This yields far fewer > backup files in the ideal scenario (context entirely matches), while > still leaving backup files when it's sensible (base file changed and > we might want to regenerate the patch). > > Thoughts / comments / concerns? Cross-posted this to a couple of > different lists to try and hit the largest number of stakeholders in > patch(1) behavior. > > Thanks, > > Kyle Evans > Kyle, you would discard the original reference for gendiff or "make makepatch" in ports, that would make patch - edit - regenerate-patch cycles require extra efforts, and if that extra effort is only remembering patch's -b option, but if we do it consistently for FreeBSD 14 and announce it in due time beforehand, fine. Certainly worthy of release notes. I personally also dislike and advise against "magic" and if-then behavior. It makes documentation less concise, it makes tool behavior more complex to judge, and from people who script a test-based approach, this bears potential for confusion, astonishment and other effects, because behavior as to when we get .orig files gets *apparently* inconsistent, and may send people who have not read the entire manual to the letter on detours finding out why they sometimes get .orig, or worse, when developing patches, and interaction with other tools might surprise people, too. IF we are to change policy, my vote is to ALWAYS leave the .orig files away and not only write them if we also write .rej files. I explicitly dislike the GNU behavior, which seems geared for interactive use rather than scripting. I checked POSIX 2018, apparently the backup files (.orig) are only required if -b is given, so omitting them would seem fine to me, and the rationale section suggests that for consistency with other utilities, the default would be to NOT save .orig file, but the -b option can be used to request them being written (but then consistently on all files not just those without rejects - also because there is no working patch -R for ed-style diffs.).