<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/diff/diff.h, branch releng/14.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-08-16T17:54:23Z</updated>
<entry>
<title>Remove $FreeBSD$: one-line .h pattern</title>
<updated>2023-08-16T17:54:23Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=42b388439bd3795e09258c57a74ce9eec3651c7b'/>
<id>urn:sha1:42b388439bd3795e09258c57a74ce9eec3651c7b</id>
<content type='text'>
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
</content>
</entry>
<entry>
<title>diff: add --no-dereference flag</title>
<updated>2022-02-18T15:17:13Z</updated>
<author>
<name>Tom Jones</name>
<email>thj@FreeBSD.org</email>
</author>
<published>2022-02-18T15:13:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f4be3645a14d4faa5a51846054318ccf77c9cd5e'/>
<id>urn:sha1:f4be3645a14d4faa5a51846054318ccf77c9cd5e</id>
<content type='text'>
When diffing files and directories, don't follow symbolic links, instead
compare where the links point to.

Reviewed by:	bapt
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34203
</content>
</entry>
<entry>
<title>diff: implement option -F (--show-function-line)</title>
<updated>2021-09-15T23:46:44Z</updated>
<author>
<name>Piotr Pawel Stefaniak</name>
<email>pstef@FreeBSD.org</email>
</author>
<published>2021-09-05T14:54:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e51aabf8cbb9b412c725c4c9c727ca6faa0630c6'/>
<id>urn:sha1:e51aabf8cbb9b412c725c4c9c727ca6faa0630c6</id>
<content type='text'>
With unified and context diffs, show the last line that matches the
provided pattern before the context.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D31714
</content>
</entry>
<entry>
<title>diff(1): Add --color support</title>
<updated>2021-09-15T23:46:44Z</updated>
<author>
<name>Cameron Katri</name>
<email>me@cameronkatri.com</email>
</author>
<published>2021-09-05T00:10:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f38702e5a52e1350b9349bc297ccd0b50b1941c3'/>
<id>urn:sha1:f38702e5a52e1350b9349bc297ccd0b50b1941c3</id>
<content type='text'>
Adds a --color flag to diff(1) that supports the same options as GNU's
diff(1). The colors are customizable with the env var DIFFCOLORS in
a format similar to grep(1)'s GREPCOLORS. An example would be 04;36:41
for additions to be underlined light blue, and deletions have a red
background.

Differential Revision:	https://reviews.freebsd.org/D30545
</content>
</entry>
<entry>
<title>diff: move functions around and reduce their visibility</title>
<updated>2021-09-15T23:36:41Z</updated>
<author>
<name>Piotr Pawel Stefaniak</name>
<email>pstef@FreeBSD.org</email>
</author>
<published>2021-09-04T23:50:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e43df07e3725ef6d14a2ca635598c18295b1b481'/>
<id>urn:sha1:e43df07e3725ef6d14a2ca635598c18295b1b481</id>
<content type='text'>
Most of them become static. There will be more such functions added in
upcoming commits, so they would be inconsistent with existing code.
Improve the existing code instead of reinforcing the unwanted pattern.
</content>
</entry>
<entry>
<title>diff: convert boolean flag variables to bool</title>
<updated>2021-09-15T23:36:41Z</updated>
<author>
<name>Piotr Pawel Stefaniak</name>
<email>pstef@FreeBSD.org</email>
</author>
<published>2021-09-04T23:44:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b5541f456d641d23e0c46874daff0b62552bf3cb'/>
<id>urn:sha1:b5541f456d641d23e0c46874daff0b62552bf3cb</id>
<content type='text'>
There will be more boolean flags added in upcoming commits and they
would have to be stored in ints in order to be consistent with existing
code. Change the existing code to use the bool type.
</content>
</entry>
<entry>
<title>diff: improve code style</title>
<updated>2021-09-15T23:36:41Z</updated>
<author>
<name>Piotr Pawel Stefaniak</name>
<email>pstef@FreeBSD.org</email>
</author>
<published>2021-08-29T09:15:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=03582021117f05fa562a2a43028b931ec21c5237'/>
<id>urn:sha1:03582021117f05fa562a2a43028b931ec21c5237</id>
<content type='text'>
Reflow comments, strip trailing space, improve wrapping of lines.
</content>
</entry>
<entry>
<title>diff: remove stalled entries in headers</title>
<updated>2021-01-27T11:18:45Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2021-01-27T11:13:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=931ad51808a650fd28be27210f25ba05d8e71199'/>
<id>urn:sha1:931ad51808a650fd28be27210f25ba05d8e71199</id>
<content type='text'>
</content>
</entry>
<entry>
<title>diff: fix incorrectly displaying files as duplicates</title>
<updated>2021-01-25T19:38:18Z</updated>
<author>
<name>Jamie Landeg-Jones</name>
<email>jamie@catflap.org</email>
</author>
<published>2021-01-25T17:42:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fefb3c46a80fdde6f307e73a2b5b5aed806df1ce'/>
<id>urn:sha1:fefb3c46a80fdde6f307e73a2b5b5aed806df1ce</id>
<content type='text'>
When diff hits certain access errors, function diffreg() shows the error
message, and then returns to the calling function, which calls
print_status() with the return value.

However, in these cases, the return value isn't changed from the initial
default value of D_SAME.

Normally, print_status() with a value of D_SAME does nothing, so this
works out ok, however, if the "-s" flag is set, a message is displayed
showing identicality:

case D_SAME:
                if (sflag)
                        printf("Files %s%s and %s%s are identical\n",                                                                                                       path1, entry, path2, entry);
                break;

This then produces such results as:

% diff  -s /COPYRIGHT /var/run/rpcbind.sock
diff: /var/run/rpcbind.sock: Operation not supported
Files /COPYRIGHT and /var/run/rpcbind.sock are identical

% diff  -s /COPYRIGHT /etc/master.passwd
diff: /etc/master.passwd: Permission denied
Files /COPYRIGHT and /etc/master.passwd are identical

Create a D_ERROR status which is returned in such cases, and
print_status() then deals with that status seperately from D_SAME

PR:		252614
MFC after:	1 week
</content>
</entry>
<entry>
<title>diff(1): reject conflicting formatting options</title>
<updated>2020-04-20T16:14:44Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-04-20T16:14:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=db9cccfbb1a724acf65756da9439009da433b810'/>
<id>urn:sha1:db9cccfbb1a724acf65756da9439009da433b810</id>
<content type='text'>
This matches GNU diff(1) behavior and, more importantly, eliminates any
source of confusion if multiple formatting options are specified.

Note that the committed diff differs slightly from the submitted: I've
modified it so that we initialize diff_format to something that isn't an
accepted format option so that we can also reject --normal -c and -c
--normal, which would've otherwise been accepted because the default was
--normal. After option parsing we default it to D_NORMAL if it's still
unset.

PR:		243975
Submitted by:	fehmi noyan isi
MFC after:	1 week
</content>
</entry>
</feed>
