Page MenuHomeFreeBSD

patch(1): Add -Vnone option to disable backup files
ClosedPublic

Authored by cem on Jul 21 2015, 9:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 9:26 PM
Unknown Object (File)
Sat, Apr 20, 9:45 PM
Unknown Object (File)
Sat, Apr 20, 7:18 PM
Unknown Object (File)
Sat, Apr 6, 10:19 AM
Unknown Object (File)
Feb 17 2024, 4:31 PM
Unknown Object (File)
Jan 18 2024, 10:17 PM
Unknown Object (File)
Dec 20 2023, 1:12 AM
Unknown Object (File)
Nov 14 2023, 1:14 AM
Tokens
"Like" token, awarded by accornehl_fastmail.fm.

Details

Test Plan

Manually applied patches with -Vnone, observed that .orig files were not
spammed throughout my tree.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem retitled this revision from to patch(1): Add -Vnone option to disable backup files.
cem updated this object.
cem edited the test plan for this revision. (Show Details)
cem added reviewers: markj, pfg.

Thank you.

FWIW, NetBSD added the same option 15 months ago:

http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/patch/

Perhaps we can reduce the differences? It helps to be able to merge changes from elsewhere.

In D3146#62739, @pfg wrote:

Thank you.

FWIW, NetBSD added the same option 15 months ago:

http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/patch/

Perhaps we can reduce the differences? It helps to be able to merge changes from elsewhere.

Hah, and we even spelled it mostly the same. Sure, I can try and make the diff smaller.

I think -Vnone is broken in NetBSD. In particular, they override none in main() after parsing the switch:

	/* parse switches */
	Argc = argc;
	Argv = argv;
	get_some_switches();

	if (backup_type == none) {
		if ((v = getenv("PATCH_VERSION_CONTROL")) == NULL)
			v = getenv("VERSION_CONTROL");
		if (v != NULL || !posix)
			backup_type = get_version(v);	/* OK to pass NULL. */
	}

And they are missing -Vnone in usage().

cem edited edge metadata.

Reorder backup_args / backup_types to diff-reduce vs NetBSD

pfg edited edge metadata.
In D3146#62741, @cem wrote:

I think -Vnone is broken in NetBSD. In particular, they override none in main() after parsing the switch:

Heh .. now I recall I was going to merge their change but something looked broken :-P.
It's alright though, I just wanted to see some diff reduction. Our patch(1) is already a fork on it's own but it also has changes from all the other BSDs.

This revision is now accepted and ready to land.Jul 21 2015, 10:46 PM
markj edited edge metadata.
This revision was automatically updated to reflect the committed changes.
In D3146#62748, @pfg wrote:

Heh .. now I recall I was going to merge their change but something looked broken :-P.
It's alright though, I just wanted to see some diff reduction. Our patch(1) is already a fork on it's own but it also has changes from all the other BSDs.

Sure, no problem. Thanks for the quick review!