<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/diff, branch releng/12.3</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.3</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.3'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2021-01-15T14:25:35Z</updated>
<entry>
<title>diff: honour flags with -q</title>
<updated>2021-01-15T14:25:35Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2021-01-09T16:22:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7366c22508e98357a17664b683841b47d268b5f8'/>
<id>urn:sha1:7366c22508e98357a17664b683841b47d268b5f8</id>
<content type='text'>
Previously -q (just print a line when files differ) ignored flags like
-w (ignore whitespace).  Avoid the D_BRIEF short-circuit when flags are
in effect.

PR:		252515
Reported by:	Scott Aitken
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28064

(cherry picked from commit 12a8d3027d414abd15798de1b6d8b01151bdac50)
</content>
</entry>
<entry>
<title>MFC r367076: diff: don't force the format to 'context' with -p immediately</title>
<updated>2020-11-14T00:59:55Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-11-14T00:59:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4292187033f17271a718b6c9fac507688ad870a9'/>
<id>urn:sha1:4292187033f17271a718b6c9fac507688ad870a9</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
</content>
</entry>
<entry>
<title>MFC r361688-r361690, r365041</title>
<updated>2020-09-19T20:15:51Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2020-09-19T20:15:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4104078b6322914194df9fc5a7b9b829fac35c2c'/>
<id>urn:sha1:4104078b6322914194df9fc5a7b9b829fac35c2c</id>
<content type='text'>
r361688:
Restore compatibility with GNU diff regarding --label

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;

r361689:
diff: restore compatibility with GNU diff regarding -N option

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;
Differential Revision: D25081

r361690:
Document long version of -b option

PR:  234195
Submitted by: Fehmi Noyan Isi &lt;fnoyanisi@yahoo.com&gt;
Reported by: Andras Farkas &lt;deepbluemistake@gmail.com&gt;

r365041:
diff: always properly kill pr(1)

When diff is invoked with -l it will spawn the pr(1) program.
In some circumpstances the pr(1) was not properly killed when diff program
exits.

Submitted by: Bret Ketchum
Differential Revision: https://reviews.freebsd.org/D26232
</content>
</entry>
<entry>
<title>MFC r363692: diff: fix side_by_side</title>
<updated>2020-08-06T18:17:19Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-08-06T18:17:19Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b77584983318f698142e5dcd80d727ad43e1f111'/>
<id>urn:sha1:b77584983318f698142e5dcd80d727ad43e1f111</id>
<content type='text'>
It's currently unclear to me how this could have worked previously; \n here
is not a literal newline but actual '\' 'n', and was getting passed to the
underlying regex engine as such. regex(3) does not translate this to a
newline, and this became an error because we don't really allow escaping
of arbitrary ordinary characters anymore.

Run the pattern strings through printf to make sure we're dealing with real
newlines before passing them through to atf_check, which ultimately feeds
them directly to regcomp(3).

This fix is different than that will be needed for sed, in that this is the
proper way to inject newlines into search strings as long as regex(3)
won't combine \ + n as folks might expect.
</content>
</entry>
<entry>
<title>MFC r360437: diff(1): don't reject specifying the same format multiple times</title>
<updated>2020-05-03T03:44:58Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-05-03T03:44:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c68318d776f4736a317145fa122fa505289e626c'/>
<id>urn:sha1:c68318d776f4736a317145fa122fa505289e626c</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.
</content>
</entry>
<entry>
<title>MFC r357875: diff: fix segfault with --tabsize and no/malformed argument</title>
<updated>2020-04-27T22:50:08Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-04-27T22:50:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=21949c4f78d666f9bd675bb0d4204cc0b73313ca'/>
<id>urn:sha1:21949c4f78d666f9bd675bb0d4204cc0b73313ca</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
</content>
</entry>
<entry>
<title>MFC r356723-r356725, r357649, r357652: diff(1) catch-up</title>
<updated>2020-04-27T22:33:32Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-04-27T22:33:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=159755a7a8f1c383404da972352cf802a4fef3f4'/>
<id>urn:sha1:159755a7a8f1c383404da972352cf802a4fef3f4</id>
<content type='text'>
r356723:
mkstemp returns -1

r356724:
asprintf returns -1, not an arbitrary value &lt; 0. Also upon error the
(very sloppy specification) leaves an undefined value in *ret, so it is
wrong to inspect it, the error condition is enough.

r356725:
When system calls indicate an error they return -1, not some arbitrary
value &lt; 0.  errno is only updated in this case.

r357649:
Update diff(1) TODO removing what has been implemented

r357652:
Fix most of the style warnings
</content>
</entry>
<entry>
<title>MFC r360125: diff(1): reject conflicting formatting options</title>
<updated>2020-04-27T22:32:16Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-04-27T22:32:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=16b191081dbc396875fd99c724de30f263ef5dff'/>
<id>urn:sha1:16b191081dbc396875fd99c724de30f263ef5dff</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
</content>
</entry>
<entry>
<title>MFC r357648:</title>
<updated>2020-03-04T11:28:49Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2020-03-04T11:28:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6d660650c9e4e569b255749c82d87cbbda384240'/>
<id>urn:sha1:6d660650c9e4e569b255749c82d87cbbda384240</id>
<content type='text'>
diff: implement -y (--side-by-side) along with -W and --suppress-common-lines

PR:		219933
Submitted by:	fehmi noyan isi &lt;fnoyanisi@yahoo.com&gt;
</content>
</entry>
<entry>
<title>MFC r356695, r356731:</title>
<updated>2020-01-20T01:38:03Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2020-01-20T01:38:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b34de56f4c5e0ded361f3fc7190e3b8a0c3d8563'/>
<id>urn:sha1:b34de56f4c5e0ded361f3fc7190e3b8a0c3d8563</id>
<content type='text'>
Optimize diff -q.

PR:	242828
</content>
</entry>
</feed>
