summaryrefslogtreecommitdiff
path: root/usr.bin/diff/diff.1
AgeCommit message (Collapse)Author
2025-06-06diff: minor fixes to manual pagePau Amma
* Add missing dash before long option name in synopsis. * Remove spurious paragraph break and bullet item. * While there, fix mandoc -T lint complaints. Reviewed by: ziaee, des Differential Revision: https://reviews.freebsd.org/D48388
2024-07-29diff: Fix usage message and documentation.Dag-Erling Smørgrav
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
2024-06-30diff: Document the --no-dereference option.Dag-Erling Smørgrav
Also, --no-dereference should not imply --recurse. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D45779
2024-03-27diff: Integrate libdiff from OpenBSD GoT.Dag-Erling Smørgrav
This adds support for two new diff algorithms, Myers diff and Patience diff. These algorithms perform a different form of search compared to the classic Stone algorithm and support escapes when worst case scenarios are encountered. Add the -A flag to allow selection of the algorithm, but default to using the new Myers diff implementation. The libdiff implementation currently only supports a subset of input and output options supported by diff. When these options are used, but the algorithm is not selected, automatically fallback to the classic Stone algorithm until support for these modes can be added. Based on work originally done by thj@ with contributions from kevans@. Sponsored by: Klara, Inc. Reviewed by: thj Differential Revision: https://reviews.freebsd.org/D44302
2024-03-19diff: Improve history section.Dag-Erling Smørgrav
Reviewed by: gbe Differential Revision: https://reviews.freebsd.org/D44409
2024-03-15diff(1) add FreeBSD HISTORYDavid E. O'Brien
2024-02-26diff: Bump manual page date.Dag-Erling Smørgrav
Sponsored by: Klara, Inc.
2024-02-26diff: Fix --expand-tabs and --side-by-side.Dag-Erling Smørgrav
* Overhaul column width and padding calculation. * Rewrite print_space() so it is now a) correct and b) understandable. * Rewrite tab expansion in fetch() for the same reason. This brings us in line with GNU diff for all cases I could think of. Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44014
2023-12-26diff(1): fix a typoPin-Yi Kuo
On the manpage of diff(1), "when" is mistyped to "wen". Event: Advanced UNIX Programming Course (Fall'23) at NTHU. Signed-off-by: Pin-Yi Kuo <kuokuoyiyi@gapp.nthu.edu.tw> Reviewed by: imp, zlei Pull Request: https://github.com/freebsd/freebsd-src/pull/943
2023-11-26usr.bin: Remove ancient SCCS tags.Warner Losh
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
2023-08-16Remove $FreeBSD$: one-line nroff patternWarner Losh
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2022-03-10diff: add support for --help and --versionTom Jones
Add support for --help and --version to be compatible with gnu diff. gnu diff --help writes to stdout, do the same to be compatible Reviewed by: bapt, pstef, debrup, Pau Amma Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D34508
2022-02-18diff: Detect Objective-C methodsTom Jones
When searching back for function definitions, consider lines starting with '+' and '-', this allows us to pick up Objective-C methods as well as C style function definitions. Reviewed by: bapt Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D34202
2021-09-16diff: implement option -F (--show-function-line)Piotr Pawel Stefaniak
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
2021-09-16diff(1): Add --color supportCameron Katri
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
2020-06-19diff(1): Add EXAMPLES sectionFernando Apesteguía
Add examples for -r, -u, -N, -x, -q and -I Approved by: 0mp@ Differential Revision: https://reviews.freebsd.org/D25345 Notes: svn path=/head/; revision=362367
2020-06-01Document long version of -b optionBaptiste Daroussin
PR: 234195 Submitted by: Fehmi Noyan Isi <fnoyanisi@yahoo.com> Reported by: Andras Farkas <deepbluemistake@gmail.com> MFC after: 3 days Notes: svn path=/head/; revision=361690
2020-02-13diff: fix segfault with --tabsize and no/malformed argumentKyle Evans
--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 <fnoyanisi yahoo com> (diff.c portion) MFC after: 3 days Notes: svn path=/head/; revision=357875
2020-02-12diff.1: Fix style & document -y as extension to POSIXMateusz Piotrowski
- Long options must be stylized with the Fl macro as well. Reviewed by: bapt Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D23642 Notes: svn path=/head/; revision=357841
2020-02-07Fix most of the style warningsBaptiste Daroussin
Notes: svn path=/head/; revision=357652
2020-02-07diff: implement -y (--side-by-side) along with -W and --suppress-common-linesBaptiste Daroussin
PR: 219933 Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com> MFC after: 3 weeks Notes: svn path=/head/; revision=357648
2018-08-19diff(1): Implement -B/--ignore-blank-linesKyle Evans
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 Notes: svn path=/head/; revision=338039
2017-04-20Cross reference pr(1) which diff might call with -l optionBaptiste Daroussin
Notes: svn path=/head/; revision=317207
2017-04-20Document all long optionsBaptiste Daroussin
Notes: svn path=/head/; revision=317205
2017-04-20Implement a basic --changed-group-formatBaptiste Daroussin
etcupdate(8) requires that option, while GNU diff supports many more variation of that options, their behaviour beside the simple verion implemented here are quite inconsistent as such I do not plan to implement those. The only special keyword supported by this implementation are: %< and %> %= is not implemented as the documentation of GNU diff says: common lines, but it actually when tested print the changes from the first file Notes: svn path=/head/; revision=317194
2017-04-08add a stub --speed-large-files for compatibility with GNU diffBaptiste Daroussin
There is no intention to implement it, but lots of scripts/tools using diff(1) passes GNU diff option Notes: svn path=/head/; revision=316639
2017-03-23diff(1): document remaining long optionsEnji Cooper
While here, try and tie together some of the short options with their long option equivalents, where possible. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315779
2017-03-22diff(1): fix SYNOPSIS section noting non-existent option, --no-ignore-caseEnji Cooper
`--no-ignore-case` should be `--no-ignore-file-name-case` per code for compatibility with [g]diff(1). Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315726
2017-03-19diff(1): add --strip-trailing-cr to last example in the SYNOPSISEnji Cooper
This syncs the last example in the SYNOPSIS with the other examples. Reviewed by: bapt Sponsored by: Dell EMC Isilon Differential Revision: D10017 Notes: svn path=/head/; revision=315590
2017-03-15diff(1): sort long options under -D example in SYNOPSYSEnji Cooper
Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315319
2017-03-12Fix wrong date in diff(1)Baptiste Daroussin
Reported by: rgrimes Notes: svn path=/head/; revision=315101
2017-03-11Import diff from OpenBSD and remove GNU diffBaptiste Daroussin
Some of the modifications from the previous summer of code has been integrated Modification for compatibility with GNU diff output has been added Main difference with OpenBSD: Implement multiple GNU diff options: * --ignore-file-name-case * --no-ignore-file-name-case * --normal * --tabsize * --strip-trailing-cr Make diff -p compatible with GNU diff Implement diff -l Make diff -r compatible with GNU diff Capsicumize diffing 2 regular files Add a simple test suite Approved by: AsiaBSDcon devsummit Obtained from: OpenBSD, GSoC Relnotes: yes Notes: svn path=/head/; revision=315051