diff(1) -c and -u options

Baptiste Daroussin bapt at FreeBSD.org
Sat Feb 15 16:03:04 UTC 2020


On Sat, Feb 15, 2020 at 06:38:03PM +1300, Fehmi Noyan ISI via freebsd-hackers wrote:
> Hi,
> 
> I am working on same changes to diff(1) (bug 243975) and noticed that one of the atf tests does this (in /usr/src/usr.bin/diff/tests/diff_test.sh unified_body())
> 
>    atf_check -o file:$(atf_get_srcdir)/unified_c9999.out -s eq:1 \
>        diff -u -c9999 -L input_c1.in -L input_c2.in "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in”
> 
> 
> when I try it out myself, -u -cNUM and -cNUM give the same output, making -u redundant here.
> GNU diff complains about incompatible output styling when -u -c are passed as arguments at the same time.
> 
> I would assume -u -cNUM was used to limit the number of output lines but the same can be achieved by -uNUM anyway.
> 
> I thought about removing this test case since it does not test anyting related to unified output (-u) (? here) but did not feel comfortable about it and though it would be worthwhile to send an email to freebsd-hackers first.
> 
> Any thoughts?

Sure go ahead, I am the author of the test suite there.

Feel free to ping me if you need.

Best regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20200215/5569deea/attachment.sig>


More information about the freebsd-hackers mailing list