<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/patch/pch.h, branch releng/12.2</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.2</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.2'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2019-12-03T18:55:09Z</updated>
<entry>
<title>MFC r351836, r351866, r354328: patch(1) /dev/null testing+improvement</title>
<updated>2019-12-03T18:55:09Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2019-12-03T18:55:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=be3a0c5043ce6f6dd57ad55276e9b67447be6867'/>
<id>urn:sha1:be3a0c5043ce6f6dd57ad55276e9b67447be6867</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Revert r311106:</title>
<updated>2017-01-02T18:23:31Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-01-02T18:23:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4f548c1916e86995b61b678743c91d689bba8581'/>
<id>urn:sha1:4f548c1916e86995b61b678743c91d689bba8581</id>
<content type='text'>
patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX.

This doesn't really work for 32 bit platforms.

Pointed out by:	kib
</content>
</entry>
<entry>
<title>patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX.</title>
<updated>2017-01-02T17:12:14Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-01-02T17:12:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ad8469feec8a84469d38b4a1237fd39abea16198'/>
<id>urn:sha1:ad8469feec8a84469d38b4a1237fd39abea16198</id>
<content type='text'>
We can handle such "big data" without much trouble.
Try to do a better job at detecting the rejection cause while here.

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>patch: unsign the line length to avoid overflows.</title>
<updated>2014-06-15T03:54:23Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2014-06-15T03:54:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c1a08643e3f6c6af2672fc7fd50251465f580489'/>
<id>urn:sha1:c1a08643e3f6c6af2672fc7fd50251465f580489</id>
<content type='text'>
Patch(1) uses a short int for the line length, which is usually
sufficient for regular diffs, but makes no effort to signal
when there is an overflow.

Change the line length to an unsigned short int to better use
the fact that a length is never negative.  The change is loosely
inspired on a related change in DragonFly, but we avoid spending
more memory than necessary.

While here adjust the messages to be clearer on what is happening.

MFC after:	1 week
</content>
</entry>
<entry>
<title>Various style(9) fixes and typos in grep, sort and patch.</title>
<updated>2014-04-21T22:52:18Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2014-04-21T22:52:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b1a409863f4784ab8a7a9fa04b3e9b3c92e7fd72'/>
<id>urn:sha1:b1a409863f4784ab8a7a9fa04b3e9b3c92e7fd72</id>
<content type='text'>
MFC after:	3 days
</content>
</entry>
<entry>
<title> - Refresh code with latest OpenBSD revisions.</title>
<updated>2013-01-29T20:05:16Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2013-01-29T20:05:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e56ef7d3586d1dea57990c7d94e260b54423ffc3'/>
<id>urn:sha1:e56ef7d3586d1dea57990c7d94e260b54423ffc3</id>
<content type='text'>
 - 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
</content>
</entry>
<entry>
<title>- Add a BSD-licensed patch, ported by Pedro F. Giffuni (pfg) from</title>
<updated>2013-01-29T17:03:18Z</updated>
<author>
<name>Gabor Kovesdan</name>
<email>gabor@FreeBSD.org</email>
</author>
<published>2013-01-29T17:03:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2dd076b84bb1129d0a62b886a4e736a9344b3376'/>
<id>urn:sha1:2dd076b84bb1129d0a62b886a4e736a9344b3376</id>
<content type='text'>
  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
</content>
</entry>
<entry>
<title>kill the undead</title>
<updated>1997-07-13T14:26:00Z</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>1997-07-13T14:26:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=65b3003d2db57c7e7f521f5f091ed7adbc151768'/>
<id>urn:sha1:65b3003d2db57c7e7f521f5f091ed7adbc151768</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Finish importing Lite2's src/usr.bin, except for ex, diff, grep, mail,</title>
<updated>1997-07-06T06:54:14Z</updated>
<author>
<name>Bruce Evans</name>
<email>bde@FreeBSD.org</email>
</author>
<published>1997-07-06T06:54:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c44252b6e8da46f58fd1882b9e7305a0f9114c16'/>
<id>urn:sha1:c44252b6e8da46f58fd1882b9e7305a0f9114c16</id>
<content type='text'>
pascal and vmstat.sparc.  All changed files on the vendor branch should
already have been imported.
</content>
</entry>
</feed>
