<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/diff/diff.c, branch releng/13.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2024-08-01T16:43:02Z</updated>
<entry>
<title>diff: Fix usage message and documentation.</title>
<updated>2024-08-01T16:43:02Z</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='https://cgit-dev.freebsd.org/src/commit/?id=ae8b85ac11257f1166dfe25c354bf0d4bd64b98d'/>
<id>urn:sha1:ae8b85ac11257f1166dfe25c354bf0d4bd64b98d</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

(cherry picked from commit ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-23T17:43:26Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3d497e17ebd33fe0f58d773e35ab994d750258d6'/>
<id>urn:sha1:3d497e17ebd33fe0f58d773e35ab994d750258d6</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in main:
(cherry picked from commit 1d386b48a555)
</content>
</entry>
<entry>
<title>diff: fix incorrectly displaying files as duplicates</title>
<updated>2021-02-01T13:05:25Z</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=3728c4d3149553967532a97254737bdb2cd92417'/>
<id>urn:sha1:3728c4d3149553967532a97254737bdb2cd92417</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

(cherry picked from commit fefb3c46a80fdde6f307e73a2b5b5aed806df1ce)
</content>
</entry>
<entry>
<title>diff: don't force the format to 'context' with -p immediately</title>
<updated>2020-10-27T12:27:26Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-10-27T12:27:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b0d30b27f0dac95224dfdb7a242dbbbe1e19930c'/>
<id>urn:sha1:b0d30b27f0dac95224dfdb7a242dbbbe1e19930c</id>
<content type='text'>
Instead, leave the fomat as unspecified (if it hasn't been) and use the
-p flag as a hint to 'context' if no other formatting option is specified.

This fixes `diff -purw`, used frequently by emaste, and matches the behavior
of its GNU counterpart.

PR:		250015
Reviewed by:	emaste
MFC after:	1 week
</content>
</entry>
<entry>
<title>diff: restore compatibility with GNU diff regarding -N option</title>
<updated>2020-06-01T09:09:36Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2020-06-01T09:09:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2816b9998c649dce97c132b8365ca697040b4c41'/>
<id>urn:sha1:2816b9998c649dce97c132b8365ca697040b4c41</id>
<content type='text'>
When -N is used the missing files are treated as empty.

PR:		233402
Submitted by:	Fehmi Noyan Isi &lt;fnoyanisi@yahoo.com&gt;
Reported by:	Roman Neuhauser &lt;roman@sigpipe.cz&gt;
MFC after:	3 days
Differential Revision:	D25081
</content>
</entry>
<entry>
<title>Restore compatibility with GNU diff regarding --label</title>
<updated>2020-06-01T09:01:13Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2020-06-01T09:01:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f096ed981fe534c36ed8662ef307042123e443f3'/>
<id>urn:sha1:f096ed981fe534c36ed8662ef307042123e443f3</id>
<content type='text'>
Various options to "diff(1)" show filenames, and traditionally make use of the
"--label" parameter, if set.

Restore this behaviour in BSD diff.

While here add a regression test

PR:		244533
Submitted by:	Jamie Landeg-Jones &lt;jamie@catflap.org&gt;
MFC after:	3 days
</content>
</entry>
<entry>
<title>diff(1): don't reject specifying the same format multiple times</title>
<updated>2020-04-28T14:33:33Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-04-28T14:33:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=67c907653e3cfcc807c96e3419bacce3b5479f1c'/>
<id>urn:sha1:67c907653e3cfcc807c96e3419bacce3b5479f1c</id>
<content type='text'>
This may happen, for instance, if one happens to have an alias of diff to
diff -up and attempts to specify the amount of context on top of that.

Aliases like this may cause other problems, but if they're really not ever
generating non-unified diffs then we should at least not break that
use-case.

In addition, we'll now pick up a format mismatch if -p is specified with
!contextual &amp;&amp; !unified &amp;&amp; !unset.

Fix up a small trailing whitespace nit in the tests while we're here, and
add tests to make sure that we can double up all the formatting options.

Reported by:	jbeich
MFC after:	3 days
</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>
<entry>
<title>diff: fix segfault with --tabsize and no/malformed argument</title>
<updated>2020-02-13T20:23:55Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-02-13T20:23:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=43fbd654516eb5ddfa2994d92b7dfd373192796e'/>
<id>urn:sha1:43fbd654516eb5ddfa2994d92b7dfd373192796e</id>
<content type='text'>
--tabsize was previously listed as optional_argument, but didn't account for
the optionality of it in the argument handling. This is irrelevant -- the
manpage doesn't indicate that the argument is optional, and indeed there's
no clear interpretation of omitting the argument because there's no other
side effect of --tabsize.

The "malformed" argument part of the header on this message is simply
referring to usage like this:

% diff --tabsize 4 A B

With an optional_argument, the argument must be attached to the parameter
directly (e.g. --tabsize=4), so the argument is effectively NULL with the
above invocation as if no argument had been passed.

PR:		243974
Submitted by:	fehmi noyan isi &lt;fnoyanisi yahoo com&gt; (diff.c portion)
MFC after:	3 days
</content>
</entry>
<entry>
<title>diff: implement -y (--side-by-side) along with -W and --suppress-common-lines</title>
<updated>2020-02-07T10:17:13Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2020-02-07T10:17:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=64793e748cfa3a3d753631a13b6ef212cd645358'/>
<id>urn:sha1:64793e748cfa3a3d753631a13b6ef212cd645358</id>
<content type='text'>
PR:		219933
Submitted by:	fehmi noyan isi &lt;fnoyanisi@yahoo.com&gt;
MFC after:	3 weeks
</content>
</entry>
</feed>
