maint: adjust to Gnulib stdbit splitup
[diffutils.git] / NEWS
blob69bec736c4141d60d2166ce156920a2d80c0c7c1
1 GNU diffutils NEWS                                    -*- outline -*-
3 * Noteworthy changes in release ?.? (????-??-??) [?]
5 ** Improvements
7   Programs now quote file names more consistently in diagnostics.
8   For example; "cmp 'none of' /etc/passwd" now might output
9   "cmp: EOF on ‘none of’ which is empty" instead of outputting
10   "cmp: EOF on none of which is empty".  In diagnostic messages
11   that traditionally omit quotes and where backward compatibility
12   seems to be important, programs continue to omit quotes unless
13   a file name contains shell metacharacters, in which case programs
14   use shell quoting.  For example, although diff continues to output
15   "Only in a: b" as before for most file names, it now outputs
16   "Only in 'a: b': 'c: d'" instead of "Only in a: b: c: d" because the
17   file names 'a: b' and 'c: d' contain spaces.  For compatibility
18   with previous practice, diff -c and -u headers continue to quote for
19   C rather than for the shell.
21   diff now outputs more information when symbolic links differ, e.g.,
22   "Symbolic links ‘d/f’ -> ‘a’ and ‘e/f’ -> ‘b’ differ", not just
23   "Symbolic links d/f and e/f differ".  Special files too, e.g.,
24   "Character special files ‘d/f’ (1, 3) and ‘e/f’ (5, 0) differ", not
25   "File d/f is a character special file while file e/f is a character
26   special file".
28   diff's --ignore-case (-i) and --ignore-file-name-case options now
29   support multi-byte characters.  For example, they treat Greek
30   capital Δ like small δ when input uses UTF-8.
32   diff now supports multi-byte characters when treating white space.
33   In options like --expand-tabs (-t), --ignore-space-change (-b) and
34   --ignore-tab-expansion (-E), diff now recognizes non-ASCII space
35   characters and counts columns for non-ASCII characters.
37 ** Bug fixes
39   cmp -bl no longer omits "M-" from bytes with the high bit set in
40   single-byte locales like en_US.iso8859-1.  This fix causes the
41   behavior to be locale independent, and to be the same as the
42   longstanding behavior in the C locale and in locales using UTF-8.
43   [bug introduced in 2.9]
45   cmp -i N and -n N no longer fail merely because N is enormous.
46   [bug present since "the beginning"]
48   cmp -s no longer mishandles /proc files, for which the Linux kernel
49   reports a zero size even when nonempty.  For example, the following
50   shell command now outputs nothing, as it should:
51     cp /proc/cmdline t; cmp -s /proc/cmdline t || echo files differ
52   [bug present since "the beginning"]
54   diff -E no longer mishandles some input lines containing '\a', '\b',
55   '\f', '\r', '\v', or '\0'.
56   [bug present since 2.8]
58   diff -ly no longer mishandles non-ASCII input.
59   [bug#64461 introduced in 2.9]
61   diff - A/B now works correctly when standard input is a directory,
62   by reading a file named B in that directory.
63   [bug present since "the beginning"]
65   diff no longer suffers from race conditions in some cases
66   when comparing files in a mutating file system.
67   [bug present since "the beginning"]
70 * Noteworthy changes in release 3.10 (2023-05-21) [stable]
72 ** Bug fixes
74   cmp/diff can again work with file dates past Y2K38
75   [bug introduced in 3.9]
77   diff -D no longer fails to output #ifndef lines.
78   [bug#61193 introduced in 3.9]
81 * Noteworthy changes in release 3.9 (2023-01-15) [stable]
83 ** Bug fixes
85   diff -c and -u no longer output incorrect timezones in headers
86   on platforms like Solaris where struct tm lacks tm_gmtoff.
87   [bug#51228 introduced in 3.4]
90 * Noteworthy changes in release 3.8 (2021-08-01) [stable]
92 ** Incompatible changes
94   diff no longer treats a closed stdin as representing an absent file
95   in usage like 'diff --new-file - foo <&-'.  This feature was rarely
96   if ever used and was not portable to POSIX platforms that reopen
97   stdin on exec, such as SELinux if the process underwent an AT_SECURE
98   transition, or HP-UX even if not setuid.
99   [bug#33965 introduced in 2.8]
101 ** Bug fixes
103   diff and related programs no longer get confused if stdin, stdout,
104   or stderr are closed.  Previously, they sometimes opened files into
105   file descriptors 0, 1, or 2 and then mistakenly did I/O with them
106   that was intended for stdin, stdout, or stderr.
107   [bug#33965 present since "the beginning"]
109   cmp, diff and sdiff no longer treat negative command-line
110   option-arguments as if they were large positive numbers.
111   [bug#35256 introduced in 2.8]
114 * Noteworthy changes in release 3.7 (2018-12-31) [stable]
116 ** Bug fixes
118   diff --strip-trailing-cr with a single CR byte in one input file
119   would provoke an uninitialized memory read, e.g.,
120     diff -a --strip-trailing-cr <(printf '\r') <(echo a)
121   [bug introduced in 2.8 with addition of the --strip-trailing-cr option]
123 ** Improvements
125   diff --color now produces output compatible with less -R.
128 * Noteworthy changes in release 3.6 (2017-05-21) [stable]
130 ** New features
132   When one file is a prefix of the other, cmp now appends the shorter
133   file's size to the EOF diagnostic.
135 ** Bug fixes
137   Using an invalid regular expression with --ignore-matching-lines=RE (-I)
138   no longer causes stack overflow.  Before, with an invocation like the
139   following, diff would diagnose the error, but would still proceed to
140   blow the stack: diff -Ia -I\\ <(echo) <(echo b)
141   [bug introduced in 2.9]
143   diff no longer mishandles line numbers exceeding 2**31 on Mingw-w64.
145   the ---presume-output-tty (ostensibly test-only) option would cause
146   diff --color to read an uninitialized variable
147   [bug introduced in 3.4]
149 ** Performance changes
151   diff's default algorithm has been tweaked to deal better with larger
152   files, reversing some of the changes made in diffutils-3.4.
155 * Noteworthy changes in release 3.5 (2016-08-20) [stable]
157 ** Bug fixes
159   diff3 no longer malfunctions due to use-after-free
160   [bug introduced in 3.4]
162   diff --color no longer colorizes when TERM=dumb
165 * Noteworthy changes in release 3.4 (2016-08-08) [stable]
167 ** New features
169    diff accepts two new options --color and --palette to generate
170    and configure colored output.  --color takes an optional argument
171    specifying when to colorize a line: --color=always, --color=auto,
172    --color=never.  --palette is used to configure which colors are used.
174 ** Bug fixes
176   When binary files differ, diff now exits with status 1 as POSIX requires.
177   Formerly it exited with status 2.
179   Unless the --ignore-file-name-case option is used, diff now
180   considers file names to be equal only if they are byte-for-byte
181   equivalent.  This fixes a bug where diff in an English locale might
182   consider two Asian file names to be the same merely because they
183   contain no English characters.
185   diff -B no longer generates incorrect output if the two inputs
186   each end with a one-byte incomplete line.
188   diff --brief no longer reports a difference for unusual identical files.
189   For example, when comparing a file like /proc/cmdline (for which the linux
190   kernel reports st_size of 0 even though it is not an empty file) to a
191   copy of that file's contents residing on a "normal" file system:
192     $ f=/proc/cmdline; cp $f k; diff --brief $f k
193     Files /proc/cmdline and k differ
195 ** Performance changes
197   diff's default algorithm has been adjusted to output higher-quality
198   results at somewhat greater computational cost, as CPUs have gotten
199   faster since the algorithm was last tweaked in diffutils-2.6 (1993).
202 * Noteworthy changes in release 3.3 (2013-03-24) [stable]
204 ** New features
206   diff accepts a new option, --no-dereference.  With this option, symbolic
207   links are treated specially: as a separate type of file that can compare
208   equal only to another symbolic link with the same value.  For example,
209   with --no-dereference, two symbolic links compare equal when they have
210   the same value, even when that value does not reference a readable file.
212   --new-file (-N) and --unidirectional-new-file now allow comparisons to "-".
213   A standard input that's closed acts like a nonexistent file.
215   A file name containing spaces, double quotes, backslashes or control
216   characters is now encoded in a diff header as a double-quoted C string
217   literal.  The escape sequences \\, \", \a, \b, \f, \n, \r, \t, \v and
218   \ooo (a three-digit octal number between 0 and 255) are used.
220 ** Packaging
222   diffutils is now designed to build with Cygwin or MinGW rather than DJGPP.
223   The ms subdirectory has been removed.
226 * Noteworthy changes in release 3.2 (2011-09-02) [stable]
228 ** Changes in behavior
230   --ignore-file-name-case now applies at the top level too.
231   For example, "diff dir inIt" might compare "dir/Init" to "inIt".
233 ** New features
235   diff and sdiff have a new option --ignore-trailing-space (-Z).
237 ** Packaging
239   The texinfo documentation no longer specifies "front-cover" or "back-cover"
240   texts, so that it may now be included in Debian's "main" section.
243 * Noteworthy changes in release 3.1 (2011-08-10) [stable]
245 ** Bug fixes
247   diff no longer reports spurious differences merely because two entries
248   in the same directory have names that compare equal in the current
249   locale, or compare equal because --ignore-file-name-case was given.
251 * Noteworthy changes in release 3.0 (2010-05-03) [stable]
253 ** Bug fixes
255   diff once again prints the required "\ No newline at end of file" line
256   when at least one input lacks a newline-at-EOF and the final hunk plus
257   context-length aligns exactly with the end of the newline-lacking file.
258   [bug introduced between 2.8.7 and 2.9]
260 ** Changes in behavior
262   In context-style diffs, diff prints a portion of a preceding "function"
263   line for each hunk, with --show-function-line=RE (-F) or
264   --show-c-function (-p).  Now, it trims leading blanks from such lines
265   before extracting a prefix.  This is useful especially when a function
266   line is so far indented that the name itself would be truncated or not
267   included in the limited-width substring that diff appends.
269   diff once again reports a difference with the diagnostic
270   "Binary files A and B differ" when at least one of the files
271   appears to be binary.  From 2.8.4 through diffutils-2.9, it printed
272   "Files A and B differ".
275 * Noteworthy changes in release 2.9 (2010-02-11) [stable]
277 ** New features
279   New diff option --suppress-blank-empty.
281   Bring back support for 'diff -NUM', where NUM is a number,
282   even when conforming to POSIX 1003.1-2001.  This change reverts to
283   the behavior of GNU diff 2.7 and earlier.  This is a change only
284   when conforming to POSIX 1003.1-2001; there is no effect when
285   conforming to older POSIX versions.
287   This change is in response to decisions taken in the January 2005
288   Austin Group standardization meeting.  For more details, please see
289   "Utility Syntax Guidelines" in the Minutes of the January 2005
290   Meeting <http://www.opengroup.org/austin/docs/austin_239.html>.
292   sdiff now understands '1' and '2' as synonyms for 'l' and 'r'.
294 ** Changes in behavior
296   sdiff and diff3 now invoke diff, not $(bindir)/diff
298 ** Administrivia
300   New discussion and bug-reporting address: bug-diffutils@gnu.org
302   updated gnulib support
305 * Noteworthy changes in release 2.8.7 (2004-04-13) [stable]
307   Version 2.8.7 contains no user-visible changes.
309 User-visible changes in version 2.8.6:
311 * New diff3 option --strip-trailing-cr.
313 * With -N and -P, inaccessible empty regular files (the kind of files
314   that 'patch' creates to indicate nonexistent backups) are now
315   treated as nonexistent when they are in the 'backup' file position.
317 * If multiple SKIP values are given to cmp, e.g., 'cmp -i 10 -i 20',
318   cmp now uses the maximal value instead of the last one.
320 * diff now omits the ".000000000" on hosts that do not support
321   fractional timestamps.
323 Version 2.8.5 was not publicly released.
325 User-visible changes in version 2.8.4:
327 * Diff now simply prints "Files A and B differ" instead of "Binary
328   files A and B differ".  The message is output if either A or B
329   appears to be a binary file, and the old wording was misleading
330   because it implied that both files are binary, which is not
331   necessarily the case.
333 User-visible changes in version 2.8.3:
335 * New locale: en_US.
337 User-visible changes in version 2.8.2:
339 * New diff and sdiff option:
340   --tabsize=COLUMNS
341 * If --ignore-space-change or --ignore-all-space is also specified,
342   --ignore-blank-lines now considers lines to be empty if they contain
343   only white space.
344 * More platforms now handle multibyte characters correctly when
345   excluding files by name (diff -x and -X).
346 * New locales: hu, pt_BR.
348 User-visible changes in version 2.8.1:
350 * Documentation fixes.
352 User-visible changes in version 2.8:
354 * cmp and diff now conform to POSIX 1003.1-2001 (IEEE Std 1003.1-2001)
355   if the underlying system conforms to POSIX and if the _POSIX2_VERSION
356   environment variable is set to 200112.  Conformance removes support
357   for 'diff -NUM', where NUM is a number.  Use -C NUM or -U NUM instead.
358 * cmp now supports trailing operands SKIP1 and SKIP2, like BSD cmp.
359 * cmp -i or --ignore-initial now accepts SKIP1:SKIP2 option value.
360 * New cmp option: -n or --bytes.
361 * cmp's old -c or --print-chars option has been renamed;
362   use -b or --print-bytes instead.
363 * cmp now outputs "byte" rather than "char" outside the POSIX locale.
364 * cmp -l's index column width now adjusts to fit larger (or smaller) files.
365 * cmp -l -s and cmp -s -l are not allowed.  Use cmp -s or cmp -l instead.
366 * diff uses ISO 8601 style timestamps for output times (e.g. "2001-11-23
367   16:44:36.875702460 -0800") unless in the C or POSIX locale and the
368   -c style is specified.
369 * diff's -I and -F options use the regexp syntax of grep, not of Emacs.
370 * diff now accepts multiple context arguments, and uses their maximum value.
371 * New diff and sdiff options:
372   -E  --ignore-tab-expansion
373   --strip-trailing-cr
374 * New diff options:
375   --from-file=FILE, --to-file=FILE
376   --ignore-file-name-case
377   --no-ignore-file-name-case
378 * New diff3 and sdiff option:
379   --diff-program=PROGRAM
380 * The following diff options are still accepted, but are no longer documented.
381   They may be withdrawn in future releases.
382   -h (omit; it has no effect)
383   -H (use --speed-large-files instead)
384   -L (use --label instead)
385   -P (use --unidirectional-new-file instead)
386   --inhibit-hunk-merge (omit; it has no effect)
387 * Recursive diffs now sort file names according to the LC_COLLATE locale
388   category if possible, instead of using native byte comparison.
389 * Recursive diffs now detect and report directory loops.
390 * Diff printf specs can now use the "0" and "'" flags.
391 * The new sdiff interactive command 'ed' precedes each version with a header.
392 * On 64-bit hosts, files larger than 2 GB can be compared.
393 * Some internationalization support has been added, but multibyte locales
394   are still not completely supported yet.
395 * Some diagnostics have been reworded slightly for consistency.
396   Also, 'diff -D FOO' now outputs '/* ! FOO */' instead of '/* not FOO */'.
397 * The 'patch' part of the manual now describes 'patch' version 2.5.4.
398 * Man pages are now distributed and installed.
399 * There is support for DJGPP; see the 'ms' subdirectory and the files
400   m4/dos.m4 and */setmode.*.
403 User-visible changes in version 2.7:
405 * New diff option: --binary (useful only on non-POSIX hosts)
406 * diff -b and -w now ignore line incompleteness; -B no longer does this.
407 * cmp -c now uses locale to decide which output characters to quote.
408 * Help and version messages are reorganized.
411 User-visible changes in version 2.6:
413 * New cmp, diff, diff3, sdiff option: --help
414 * A new heuristic for diff greatly reduces the time needed to compare
415   large input files that contain many differences.
416 * Partly as a result, GNU diff's output is not exactly the same as before.
417   Usually it is a bit smaller, but sometimes it is a bit larger.
420 User-visible changes in version 2.5:
422 * New cmp option: -v --version
425 User-visible changes in version 2.4:
427 * New cmp option: --ignore-initial=BYTES
428 * New diff3 option: -T --initial-tab
429 * New diff option: --line-format=FORMAT
430 * New diff group format specifications:
431   <PRINTF_SPEC>[eflmnEFLMN]
432       A printf spec followed by one of the following letters
433       causes the integer corresponding to that letter to be
434       printed according to the printf specification.
435       E.g. '%5df' prints the number of the first line in the
436       group in the old file using the "%5d" format.
437         e: line number just before the group in old file; equals f - 1
438         f: first line number in group in the old file
439         l: last line number in group in the old file
440         m: line number just after the group in old file; equals l + 1
441         n: number of lines in group in the old file; equals l - f + 1
442         E, F, L, M, N: likewise, for lines in the new file
443   %(A=B?T:E)
444       If A equals B then T else E.  A and B are each either a decimal
445       constant or a single letter interpreted as above.  T and E are
446       arbitrary format strings.  This format spec is equivalent to T if
447       A's value equals B's; otherwise it is equivalent to E.  For
448       example, '%(N=0?no:%dN) line%(N=1?:s)' is equivalent to 'no lines'
449       if N (the number of lines in the group in the new file) is 0,
450       to '1 line' if N is 1, and to '%dN lines' otherwise.
451   %c'C'
452       where C is a single character, stands for the character C.  C may not
453       be a backslash or an apostrophe.  E.g. %c':' stands for a colon.
454   %c'\O'
455       where O is a string of 1, 2, or 3 octal digits, stands for the
456       character with octal code O.  E.g. %c'\0' stands for a null character.
457 * New diff line format specifications:
458   <PRINTF_SPEC>n
459       The line number, printed with <PRINTF_SPEC>.
460       E.g. '%5dn' prints the line number with a "%5d" format.
461   %c'C'
462   %c'\O'
463       The character C, or with octal code O, as above.
464 * Supported <PRINTF_SPEC>s have the same meaning as with printf, but must
465   match the extended regular expression %-*[0-9]*(\.[0-9]*)?[doxX].
466 * The format spec %0 introduced in version 2.1 has been removed, since it
467   is incompatible with printf specs like %02d.  To represent a null char,
468   use %c'\0' instead.
469 * cmp and diff now conform to POSIX 1003.2-1992 (ISO/IEC 9945-2:1993)
470   if the underlying system conforms to POSIX:
471   - Some messages' wordings are changed in minor ways.
472   - "White space" is now whatever C's 'isspace' says it is.
473   - When comparing directories, if 'diff' finds a file that is not a regular
474     file or a directory, it reports the file's type instead of diffing it.
475     (As usual, it follows symbolic links first.)
476   - When signaled, sdiff exits with the signal's status, not with status 2.
477 * Now portable to hosts where int, long, pointer, etc. are not all the same
478   size.
479 * 'cmp - -' now works like 'diff - -'.
482 User-visible changes in version 2.3:
484 * New diff option: --horizon-lines=lines
487 User-visible changes in version 2.1:
489 * New diff options:
490   --{old,new,unchanged}-line-format='format'
491   --{old,new,unchanged,changed}-group-format='format'
492   -U
493 * New diff3 option:
494   -A --show-all
495 * diff3 -m now defaults to -A, not -E.
496 * diff3 now takes up to three -L or --label options, not just two.
497   If just two options are given, they refer to the first two input files,
498   not the first and third input files.
499 * sdiff and diff -y handle incomplete lines.
502 User-visible changes in version 2.0:
504 * Add sdiff and cmp programs.
505 * Add Texinfo documentation.
506 * Add configure script.
507 * Improve diff performance.
508 * New diff options:
509 -x --exclude
510 -X --exclude-from
511 -P --unidirectional-new-file
512 -W --width
513 -y --side-by-side
514 --left-column
515 --sdiff-merge-assist
516 --suppress-common-lines
517 * diff options renamed:
518 --label renamed from --file-label
519 --forward-ed renamed from --reversed-ed
520 --paginate renamed from --print
521 --entire-new-file renamed from --entire-new-files
522 --new-file renamed from --new-files
523 --all-text removed
524 * New diff3 options:
525 -v --version
526 * Add long-named equivalents for other diff3 options.
527 * diff options -F (--show-function-line) and -I (--ignore-matching-lines)
528   can now be given more than once.
532 Copyright (C) 1993-1994, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2024 Free
533 Software Foundation, Inc.
535 This file is part of GNU Diffutils.
537 This program is free software: you can redistribute it and/or modify
538 it under the terms of the GNU General Public License as published by
539 the Free Software Foundation, either version 3 of the License, or
540 (at your option) any later version.
542 This program is distributed in the hope that it will be useful,
543 but WITHOUT ANY WARRANTY; without even the implied warranty of
544 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
545 GNU General Public License for more details.
547 You should have received a copy of the GNU General Public License
548 along with this program.  If not, see <http://www.gnu.org/licenses/>.