<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/diff/diff.c, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>http://cgit.freebsd.org/src/atom?h=main</id>
<link rel='self' href='http://cgit.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<updated>2026-02-13T20:19:16Z</updated>
<entry>
<title>diff: Tweak range of -C and -U arguments</title>
<updated>2026-02-13T20:19:16Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-13T20:18:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=790f1d1cc5fa892ba59fd7f239b22064c8ab14c7'/>
<id>urn:sha1:790f1d1cc5fa892ba59fd7f239b22064c8ab14c7</id>
<content type='text'>
POSIX uses the terms “positive decimal integer” for -C and “non-negative
decimal integer” for -U, which translates into lower bounds of 1 for -C
and 0 for -U.

POSIX does not specify a minimum upper bound for either mode, but as of
5fc739eb5949 both our backends support context sizes up to and including
INT_MAX, so use that.

Having had the opportunity to consult the Unix System Test Suite, the
diff test cases found therein happen to precisely match these bounds.

While here, switch to using strtonum() to parse numerical arguments, and
try to be more consistent in how we report usage errors.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D55261
</content>
</entry>
<entry>
<title>diff: Bump version number</title>
<updated>2026-02-06T00:14:05Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-06T00:13:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=40134060f6583486ad8ab303140fa73960d3de3d'/>
<id>urn:sha1:40134060f6583486ad8ab303140fa73960d3de3d</id>
<content type='text'>
MFC after:	1 week
Sponsored by:	Klara, Inc.
</content>
</entry>
<entry>
<title>diff: fix support for -l with new diff algorithm</title>
<updated>2026-02-02T16:13:16Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2026-02-02T15:43:29Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4d73b07d02d12cdff0558d3ca6c4b3224cae831f'/>
<id>urn:sha1:4d73b07d02d12cdff0558d3ca6c4b3224cae831f</id>
<content type='text'>
MFC After: 3 days
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D55052
</content>
</entry>
<entry>
<title>diff: Fix usage message and documentation.</title>
<updated>2024-07-29T14:02:21Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2024-07-29T14:02:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6'/>
<id>urn:sha1:ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6</id>
<content type='text'>
The `--ignore-all-space` option was incorrectly documented as
`--ignore-all-blanks` in some (but not all) places.

MFC after:	3 days
PR:		280434
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, markj
Differential Revision:	https://reviews.freebsd.org/D46160
</content>
</entry>
<entry>
<title>diff: Document the --no-dereference option.</title>
<updated>2024-06-30T15:55:27Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2024-06-30T15:55:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4ce4a0fe14c455c6ec77452bc99cd93ea45737b1'/>
<id>urn:sha1:4ce4a0fe14c455c6ec77452bc99cd93ea45737b1</id>
<content type='text'>
Also, --no-dereference should not imply --recurse.

MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D45779
</content>
</entry>
<entry>
<title>diff: Sort headers.</title>
<updated>2024-05-03T15:03:50Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2024-05-03T15:03:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=eea5f8d408604c2f70e068f7806a226fe01fc559'/>
<id>urn:sha1:eea5f8d408604c2f70e068f7806a226fe01fc559</id>
<content type='text'>
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D45078
</content>
</entry>
<entry>
<title>diff: use getline() instead of fgetln()</title>
<updated>2024-04-19T21:52:21Z</updated>
<author>
<name>Martin Tournoij</name>
<email>martin@arp242.net</email>
</author>
<published>2024-04-19T21:11:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9744821765fccd6c9b44d47804b6913cdf616d4e'/>
<id>urn:sha1:9744821765fccd6c9b44d47804b6913cdf616d4e</id>
<content type='text'>
This replaces fgetln() with getline(). The main reason for this is
portability, making things easier for people who want to compile these
tools on non-FreeBSD systems.

I appreciate that's probably not the top concern for FreeBSD base tools,
but fgetln() is impossible to port to most platforms, as concurrent
access is essentially impossible to implement fully correct without the
line buffer on the FILE struct. Other than this, many generic FreeBSD
tools compile fairly cleanly on Linux with a few small changes.

Most uses of fgetln() pre-date getline() support (added in 2009 with
69099ba2ec8b), and there's been some previous patches (ee3ca711a898
8c98e6b1a7f3 1a2a4fc8ce1b) for other tools.

Obtained from:	https://github.com/dcantrell/bsdutils and
              	https://github.com/chimera-linux/chimerautils
Signed-off-by: Martin Tournoij &lt;martin@arp242.net&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/893
</content>
</entry>
<entry>
<title>diff: Integrate libdiff from OpenBSD GoT.</title>
<updated>2024-03-27T10:03:33Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2024-03-27T10:03:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d9a9f23d0b3f1676d5656b76301341c0037d15b7'/>
<id>urn:sha1:d9a9f23d0b3f1676d5656b76301341c0037d15b7</id>
<content type='text'>
This adds support for two new diff algorithms, Myers diff and Patience
diff.

These algorithms perform a different form of search compared to the
classic Stone algorithm and support escapes when worst case scenarios
are encountered.

Add the -A flag to allow selection of the algorithm, but default to
using the new Myers diff implementation.

The libdiff implementation currently only supports a subset of input and
output options supported by diff.  When these options are used, but the
algorithm is not selected, automatically fallback to the classic Stone
algorithm until support for these modes can be added.

Based on work originally done by thj@ with contributions from kevans@.

Sponsored by:	Klara, Inc.
Reviewed by:	thj
Differential Revision:	https://reviews.freebsd.org/D44302
</content>
</entry>
<entry>
<title>diff: Fix --expand-tabs and --side-by-side.</title>
<updated>2024-02-26T18:08:06Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2024-02-26T18:08:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=53de23f4d140becc3166e87665b0064f215a220e'/>
<id>urn:sha1:53de23f4d140becc3166e87665b0064f215a220e</id>
<content type='text'>
* Overhaul column width and padding calculation.
* Rewrite print_space() so it is now a) correct and b) understandable.
* Rewrite tab expansion in fetch() for the same reason.

This brings us in line with GNU diff for all cases I could think of.

Sponsored by:	Klara, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D44014
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:42Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1d386b48a555f61cb7325543adbbb5c3f3407a66'/>
<id>urn:sha1:1d386b48a555f61cb7325543adbbb5c3f3407a66</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
</entry>
</feed>
