<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test/usr.bin/diff/tests/diff_test.sh, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/'/>
<updated>2020-07-30T13:33:45Z</updated>
<entry>
<title>diff: fix side_by_side after r363679</title>
<updated>2020-07-30T13:33:45Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-07-30T13:33:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=ac05de17883d6981f9ff3d52154ec336203fc683'/>
<id>urn:sha1:ac05de17883d6981f9ff3d52154ec336203fc683</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.

Reported by:	Jenkins via lwhsu
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-test/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-test/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-test/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-test/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-test/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-test/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>
<entry>
<title>diff(1): Implement -B/--ignore-blank-lines</title>
<updated>2018-08-19T03:57:20Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-08-19T03:57:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=e68edb8cf06a796453378b98d963692c838c400f'/>
<id>urn:sha1:e68edb8cf06a796453378b98d963692c838c400f</id>
<content type='text'>
As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag.
This was not previously implemented here, so one was forced to create a link
for GNU diff to /usr/local/bin/diff

Implement the -B flag and add some primitive tests for it. It is implemented
in the same fashion that -I is implemented; each chunk's lines are scanned,
and if a non-blank line is encountered then the chunk will be output.
Otherwise, it's skipped.

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Improve --strip-trailing-cr handling:</title>
<updated>2018-07-27T05:21:20Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2018-07-27T05:21:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=9977c7b5127ed393b291323fc095f65b39ab7a99'/>
<id>urn:sha1:9977c7b5127ed393b291323fc095f65b39ab7a99</id>
<content type='text'>
 - Advance ctold for f1 and ctnew for f2
 - ungetc() if the character is unexpected
 - Don't break early when we hit the combination on one side

PR:		230049
Reported by:	maskray &lt;emacsray gmail com&gt;
Reviewed by:	bapt, maskray
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16451
</content>
</entry>
<entry>
<title>Add tests that exercise -q, like -rq and add tests that test -q like -Nrq</title>
<updated>2017-07-17T18:07:53Z</updated>
<author>
<name>Enji Cooper</name>
<email>ngie@FreeBSD.org</email>
</author>
<published>2017-07-17T18:07:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=4017abe27c6436d80a08577c6e9ae0e9dc11d7ec'/>
<id>urn:sha1:4017abe27c6436d80a08577c6e9ae0e9dc11d7ec</id>
<content type='text'>
MFC after:	2 months
MFC with:	r321076, r321077, r321078
</content>
</entry>
</feed>
