Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Apr 2022 16:42:18 +0000
From:      Pau Amma <pauamma@gundo.com>
To:        Kyle Evans <kevans@freebsd.org>
Cc:        freebsd-arch@freebsd.org, FreeBSD Hackers <freebsd-hackers@freebsd.org>, ports-list freebsd <freebsd-ports@freebsd.org>
Subject:   Re: [RFC] patch's default backup behavior
Message-ID:  <ba549529a62b8af853c3465d95401562@gundo.com>
In-Reply-To: <CACNAnaGTZSGKP=FKT1deAjJ0W=Q5Ezqf0ZinC2ydDzUksk%2BFtw@mail.gmail.com>
References:  <CACNAnaGTZSGKP=FKT1deAjJ0W=Q5Ezqf0ZinC2ydDzUksk%2BFtw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2022-04-09 03:25, Kyle Evans wrote:
> 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

I don't know what GNU patch does, but I had a look at SUSv4, which says 
-b always creates .orig files and not using -b never does. But you sound 
like you're actually speaking of .rej files, not .orig files.

> (presumably this means either
> a hunk needed fuzz or a hunk outright failed).

SUSv4 says a .rej is created when applying the hunk fails completely, 
but not if the before context is found after fuzzing, that is 
either/both near where if was expected and after trimming some outer 
lines of it. (There's no option to control whether/when a .rej is 
created.)

> 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).

I feel that way about the SUSv4 version, but I'm not sure how conformant 
the GNU version is, or what you think should happen with respect to .rej 
files.

> 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.

I'm not sure -arch@ will accept my reply. This may or may not split the 
discussion.

-- 
#BlackLivesMatter #TransWomenAreWomen #AccessibilityMatters 
#StandWithUkrainians
English: he/him/his (singular they/them/their/theirs OK)
French: il/le/lui (iel/iel and ielle/ielle OK)
Tagalog: siya/niya/kaniya (please avoid sila/nila/kanila)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ba549529a62b8af853c3465d95401562>