Re: [RFC] patch's default backup behavior

From: Mark Murray <>
Date: Thu, 14 Apr 2022 07:44:52 UTC
Thank you David. Well said!


> On 12 Apr 2022, at 17:36, David Chisnall <> wrote:
> On 11/04/2022 17:58, Rodney W. Grimes wrote:
>> Personally, if YOU like the behavior of gnu patch, by all means,
>> please USE gnu patch.  Please do NOT make bsd patch behave in
>> a different manner simply because you personally like that
>> other behavior.
>> If you want the stuff to look like Linux/GNU by all means,
>> go RUN linux/gnu!!!!
> There are two opinions that as almost invariably wrong, in any context:
> - Popular thing X does Y, therefore Y is good.
> - Popular thing X does Y, therefore Y is bad.
> This thread started with 'popular thing X does Y, we do Z, let's evaluate which is better'.  Reducing that to 'popular thing X does Y, therefore we should do Z, if you want Y then you should run X' is unhelpful.  It is also how we end up in a situation where everyone runs X and we sit around wondering where all of our users and contributors went.
> We should neither adopt or discard a particular behaviour in patch on the basis that GNU patch does it.  We should use the fact that GNU patch does it to gather data on whether it's a desirable behaviour.  We should adopt their good ideas and avoid their bad ideas.
> That is precisely the process that Kyle is trying to drive and the FreeBSD system will be better as a result of his work.  Personally, I hate having .rej and .orig files scattered over my filesystem as a result of patch failing and I end up having to write a `find` command to delete them all.  Does that mean that I want to give up kqueue, capsicum, out-of-the-box ZFS, a sane /dev/dsp, jails, clang as the system compiler, a `tar` that knows that `x` means 'extract the thing, you don't need me to duplicate the information in the file header to know what it is', and so on and run GNU/Linux?  No.
> I take Joerg's point that GNU patch *sometimes* creating them makes tooling difficult.  I would be quite happy with a solution that they are created unconditionally with a flag to disable creating them (I would then `alias patch="patch --do-not-leave-stuff-on-my-filesystem"` in my `.profile` and forget about it for interactive use) or that they are never created with a flag to enable creating them, which I would never pass except when working with bits of infrastructure that explicitly want the .orig files.
> David

Mark R V Murray