aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.1
Commit message (Collapse)AuthorAgeFilesLines
* MFC r368807: patch(1): Fix a few mandoc related issuesGordon Bergling2020-12-271-6/+6
| | | | | | - no blank before trailing delimiter (cherry picked from commit a2f1c81b286c528a8efedf224a13e476dba1de42)
* MFC r351836, r351866, r354328: patch(1) /dev/null testing+improvementKyle Evans2019-12-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r351836: patch(1): add some basic tests Summary: - basic: test application of patches created by diff -u at the beginning/middle/end of file, which have differing amounts of context before and after chunks being added - limited_ctx: stems from PR 74127 in which a rogue line was getting added when the patch should have been rejected. Similar behavior was reproducible with larger contexts near the beginning/end of a file. See r326084 for details - file_creation: patch sourced from /dev/null should create the file - file_nodupe: said patch sourced from /dev/null shouldn't dupe the contents when re-applied (personal vendetta, WIP, see comment) - file_removal: this follows from nodupe; the reverse of a patch sourced from /dev/null is most naturally deleting the file, as is expected based on GNU patch behavior (WIP) r351866: patch(1): fix the file removal test, strengthen it a bit To remain compatible with GNU patch, we should ensure that once we're removing empty files after a reversed /dev/null patch we don't remove files that have been modified. GNU patch leaves these intact and just reverses the hunk that created the file, effectively implying --remove-empty-files for reversed /dev/null patches. r354328: patch(1): give /dev/null patches special treatment We have a bad habit of duplicating contents of files that are sourced from /dev/null and applied more than once... take the more sane (in most ways) GNU route and complain if the file exists and offer reversal options. This still falls short a little bit as selecting "don't reverse, apply anyway" will still give you duplicated file contents. There's probably other issues as well, but awareness is the first step to happiness. Notes: svn path=/stable/12/; revision=355351
* Remove automatic checkout feature.Xin LI2015-08-151-14/+5
| | | | | | | | | Obtained from: DragonFly via OpenBSD Relnotes: yes MFC: never Notes: svn path=/head/; revision=286795
* patch(1): Add -Vnone option to disable backup filesConrad Meyer2015-07-211-4/+6
| | | | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D3146 Reviewed by: pfg Approved by: markj (mentor) MFC after: 1 week Relnotes: yes Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=285772
* patch: add dry-run alias for compatibility with other implementations.Pedro F. Giffuni2014-06-151-2/+2
| | | | | | | | | | | | | Other implementations of patch(1), including GNU patch and "svn patch" have a --dry-run option which does the same as our -C or --check option. Add a new alias to make our implementation more compatible. MFC after: 1 week Notes: svn path=/head/; revision=267512
* Avoid zeroing during allocation.Pedro F. Giffuni2014-06-121-8/+5
| | | | | | | | | | | | | | | | | This change reverts a change from OpenBSD which made use of calloc, and therefore wasted time initializing arrays that will later be realloc'ed. Consistently use FreeBSD's reallocf(). While here also merge the changes from OpenBSD's manpage patch.1 Rev 1.27: "patch was moved from user portability (UP) to base in issue 7 and is no longer optional" MFC after: 1 week Notes: svn path=/head/; revision=267426
* Remove contractions.Joel Dahl2013-04-111-8/+8
| | | | Notes: svn path=/head/; revision=249373
* - Refresh code with latest OpenBSD revisions.Xin LI2013-01-291-25/+25
| | | | | | | | | | | | - Remove $DragonFly$ tags as they are using git nowadays and VCS tags will not help merging. - Other changes to Copyright headers to make them consistent with other source code, we intend to fork from this point. Reviewed by: pfg Notes: svn path=/head/; revision=246091
* - Add a BSD-licensed patch, ported by Pedro F. Giffuni (pfg) fromGabor Kovesdan2013-01-291-0/+700
| | | | | | | | | | | DragonflyBSD and install it as bsdpatch. WITH_BSD_PATCH makes it default and installs GNU patch as gnupatch. Submitted by: pfg Obtained from: The DragonflyBSD Project Notes: svn path=/head/; revision=246074
* kill the undeadPeter Wemm1997-07-131-446/+0
| | | | Notes: svn path=/head/; revision=27369
* Finish importing Lite2's src/usr.bin, except for ex, diff, grep, mail,Bruce Evans1997-07-061-0/+446
pascal and vmstat.sparc. All changed files on the vendor branch should already have been imported. Notes: svn path=/vendor/CSRG/dist/; revision=27241