1 GNU diffutils NEWS -*- outline -*-
3 * Noteworthy changes in release 3.8 (2021-08-01) [stable]
5 ** Incompatible changes
7 diff no longer treats a closed stdin as representing an absent file
8 in usage like 'diff --new-file - foo <&-'. This feature was rarely
9 if ever used and was not portable to POSIX platforms that reopen
10 stdin on exec, such as SELinux if the process underwent an AT_SECURE
11 transition, or HP-UX even if not setuid.
12 [bug#33965 introduced in 2.8]
16 diff and related programs no longer get confused if stdin, stdout,
17 or stderr are closed. Previously, they sometimes opened files into
18 file descriptors 0, 1, or 2 and then mistakenly did I/O with them
19 that was intended for stdin, stdout, or stderr.
20 [bug#33965 present since "the beginning"]
22 cmp, diff and sdiff no longer treat negative command-line
23 option-arguments as if they were large positive numbers.
24 [bug#35256 introduced in 2.8]
27 * Noteworthy changes in release 3.7 (2018-12-31) [stable]
31 diff --strip-trailing-cr with a single CR byte in one input file
32 would provoke an uninitialized memory read, e.g.,
33 diff -a --strip-trailing-cr <(printf '\r') <(echo a)
34 [bug introduced in 2.8 with addition of the --strip-trailing-cr option]
38 diff --color now produces output compatible with less -R.
41 * Noteworthy changes in release 3.6 (2017-05-21) [stable]
45 When one file is a prefix of the other, cmp now appends the shorter
46 file's size to the EOF diagnostic.
50 Using an invalid regular expression with --ignore-matching-lines=RE (-I)
51 no longer causes stack overflow. Before, with an invocation like the
52 following, diff would diagnose the error, but would still proceed to
53 blow the stack: diff -Ia -I\\ <(echo) <(echo b)
54 [bug introduced in 2.9]
56 diff no longer mishandles line numbers exceeding 2**31 on Mingw-w64.
58 the ---presume-output-tty (ostensibly test-only) option would cause
59 diff --color to read an uninitialized variable
60 [bug introduced in 3.4]
62 ** Performance changes
64 diff's default algorithm has been tweaked to deal better with larger
65 files, reversing some of the changes made in diffutils-3.4.
68 * Noteworthy changes in release 3.5 (2016-08-20) [stable]
72 diff3 no longer malfunctions due to use-after-free
73 [bug introduced in 3.4]
75 diff --color no longer colorizes when TERM=dumb
78 * Noteworthy changes in release 3.4 (2016-08-08) [stable]
82 diff accepts two new options --color and --palette to generate
83 and configure colored output. --color takes an optional argument
84 specifying when to colorize a line: --color=always, --color=auto,
85 --color=never. --palette is used to configure which colors are used.
89 When binary files differ, diff now exits with status 1 as POSIX requires.
90 Formerly it exited with status 2.
92 Unless the --ignore-file-name-case option is used, diff now
93 considers file names to be equal only if they are byte-for-byte
94 equivalent. This fixes a bug where diff in an English locale might
95 consider two Asian file names to be the same merely because they
96 contain no English characters.
98 diff -B no longer generates incorrect output if the two inputs
99 each end with a one-byte incomplete line.
101 diff --brief no longer reports a difference for unusual identical files.
102 For example, when comparing a file like /proc/cmdline (for which the linux
103 kernel reports st_size of 0 even though it is not an empty file) to a
104 copy of that file's contents residing on a "normal" file system:
105 $ f=/proc/cmdline; cp $f k; diff --brief $f k
106 Files /proc/cmdline and k differ
108 ** Performance changes
110 diff's default algorithm has been adjusted to output higher-quality
111 results at somewhat greater computational cost, as CPUs have gotten
112 faster since the algorithm was last tweaked in diffutils-2.6 (1993).
115 * Noteworthy changes in release 3.3 (2013-03-24) [stable]
119 diff accepts a new option, --no-dereference. With this option, symbolic
120 links are treated specially: as a separate type of file that can compare
121 equal only to another symbolic link with the same value. For example,
122 with --no-dereference, two symbolic links compare equal when they have
123 the same value, even when that value does not reference a readable file.
125 --new-file (-N) and --unidirectional-new-file now allow comparisons to "-".
126 A standard input that's closed acts like a nonexistent file.
128 A file name containing spaces, double quotes, backslashes or control
129 characters is now encoded in a diff header as a double-quoted C string
130 literal. The escape sequences \\, \", \a, \b, \f, \n, \r, \t, \v and
131 \ooo (a three-digit octal number between 0 and 255) are used.
135 diffutils is now designed to build with Cygwin or MinGW rather than DJGPP.
136 The ms subdirectory has been removed.
139 * Noteworthy changes in release 3.2 (2011-09-02) [stable]
141 ** Changes in behavior
143 --ignore-file-name-case now applies at the top level too.
144 For example, "diff dir inIt" might compare "dir/Init" to "inIt".
148 diff and sdiff have a new option --ignore-trailing-space (-Z).
152 The texinfo documentation no longer specifies "front-cover" or "back-cover"
153 texts, so that it may now be included in Debian's "main" section.
156 * Noteworthy changes in release 3.1 (2011-08-10) [stable]
160 diff no longer reports spurious differences merely because two entries
161 in the same directory have names that compare equal in the current
162 locale, or compare equal because --ignore-file-name-case was given.
164 * Noteworthy changes in release 3.0 (2010-05-03) [stable]
168 diff once again prints the required "\ No newline at end of file" line
169 when at least one input lacks a newline-at-EOF and the final hunk plus
170 context-length aligns exactly with the end of the newline-lacking file.
171 [bug introduced between 2.8.7 and 2.9]
173 ** Changes in behavior
175 In context-style diffs, diff prints a portion of a preceding "function"
176 line for each hunk, with --show-function-line=RE (-F) or
177 --show-c-function (-p). Now, it trims leading blanks from such lines
178 before extracting a prefix. This is useful especially when a function
179 line is so far indented that the name itself would be truncated or not
180 included in the limited-width substring that diff appends.
182 diff once again reports a difference with the diagnostic
183 "Binary files A and B differ" when at least one of the files
184 appears to be binary. From 2.8.4 through diffutils-2.9, it printed
185 "Files A and B differ".
188 * Noteworthy changes in release 2.9 (2010-02-11) [stable]
192 New diff option --suppress-blank-empty.
194 Bring back support for 'diff -NUM', where NUM is a number,
195 even when conforming to POSIX 1003.1-2001. This change reverts to
196 the behavior of GNU diff 2.7 and earlier. This is a change only
197 when conforming to POSIX 1003.1-2001; there is no effect when
198 conforming to older POSIX versions.
200 This change is in response to decisions taken in the January 2005
201 Austin Group standardization meeting. For more details, please see
202 "Utility Syntax Guidelines" in the Minutes of the January 2005
203 Meeting <http://www.opengroup.org/austin/docs/austin_239.html>.
205 sdiff now understands '1' and '2' as synonyms for 'l' and 'r'.
207 ** Changes in behavior
209 sdiff and diff3 now invoke diff, not $(bindir)/diff
213 New discussion and bug-reporting address: bug-diffutils@gnu.org
215 updated gnulib support
218 * Noteworthy changes in release 2.8.7 (2004-04-13) [stable]
220 Version 2.8.7 contains no user-visible changes.
222 User-visible changes in version 2.8.6:
224 * New diff3 option --strip-trailing-cr.
226 * With -N and -P, inaccessible empty regular files (the kind of files
227 that 'patch' creates to indicate nonexistent backups) are now
228 treated as nonexistent when they are in the 'backup' file position.
230 * If multiple SKIP values are given to cmp, e.g., 'cmp -i 10 -i 20',
231 cmp now uses the maximal value instead of the last one.
233 * diff now omits the ".000000000" on hosts that do not support
234 fractional timestamps.
236 Version 2.8.5 was not publicly released.
238 User-visible changes in version 2.8.4:
240 * Diff now simply prints "Files A and B differ" instead of "Binary
241 files A and B differ". The message is output if either A or B
242 appears to be a binary file, and the old wording was misleading
243 because it implied that both files are binary, which is not
244 necessarily the case.
246 User-visible changes in version 2.8.3:
250 User-visible changes in version 2.8.2:
252 * New diff and sdiff option:
254 * If --ignore-space-change or --ignore-all-space is also specified,
255 --ignore-blank-lines now considers lines to be empty if they contain
257 * More platforms now handle multibyte characters correctly when
258 excluding files by name (diff -x and -X).
259 * New locales: hu, pt_BR.
261 User-visible changes in version 2.8.1:
263 * Documentation fixes.
265 User-visible changes in version 2.8:
267 * cmp and diff now conform to POSIX 1003.1-2001 (IEEE Std 1003.1-2001)
268 if the underlying system conforms to POSIX and if the _POSIX2_VERSION
269 environment variable is set to 200112. Conformance removes support
270 for 'diff -NUM', where NUM is a number. Use -C NUM or -U NUM instead.
271 * cmp now supports trailing operands SKIP1 and SKIP2, like BSD cmp.
272 * cmp -i or --ignore-initial now accepts SKIP1:SKIP2 option value.
273 * New cmp option: -n or --bytes.
274 * cmp's old -c or --print-chars option has been renamed;
275 use -b or --print-bytes instead.
276 * cmp now outputs "byte" rather than "char" outside the POSIX locale.
277 * cmp -l's index column width now adjusts to fit larger (or smaller) files.
278 * cmp -l -s and cmp -s -l are not allowed. Use cmp -s or cmp -l instead.
279 * diff uses ISO 8601 style timestamps for output times (e.g. "2001-11-23
280 16:44:36.875702460 -0800") unless in the C or POSIX locale and the
281 -c style is specified.
282 * diff's -I and -F options use the regexp syntax of grep, not of Emacs.
283 * diff now accepts multiple context arguments, and uses their maximum value.
284 * New diff and sdiff options:
285 -E --ignore-tab-expansion
288 --from-file=FILE, --to-file=FILE
289 --ignore-file-name-case
290 --no-ignore-file-name-case
291 * New diff3 and sdiff option:
292 --diff-program=PROGRAM
293 * The following diff options are still accepted, but are no longer documented.
294 They may be withdrawn in future releases.
295 -h (omit; it has no effect)
296 -H (use --speed-large-files instead)
297 -L (use --label instead)
298 -P (use --unidirectional-new-file instead)
299 --inhibit-hunk-merge (omit; it has no effect)
300 * Recursive diffs now sort file names according to the LC_COLLATE locale
301 category if possible, instead of using native byte comparison.
302 * Recursive diffs now detect and report directory loops.
303 * Diff printf specs can now use the "0" and "'" flags.
304 * The new sdiff interactive command 'ed' precedes each version with a header.
305 * On 64-bit hosts, files larger than 2 GB can be compared.
306 * Some internationalization support has been added, but multibyte locales
307 are still not completely supported yet.
308 * Some diagnostics have been reworded slightly for consistency.
309 Also, 'diff -D FOO' now outputs '/* ! FOO */' instead of '/* not FOO */'.
310 * The 'patch' part of the manual now describes 'patch' version 2.5.4.
311 * Man pages are now distributed and installed.
312 * There is support for DJGPP; see the 'ms' subdirectory and the files
313 m4/dos.m4 and */setmode.*.
316 User-visible changes in version 2.7:
318 * New diff option: --binary (useful only on non-POSIX hosts)
319 * diff -b and -w now ignore line incompleteness; -B no longer does this.
320 * cmp -c now uses locale to decide which output characters to quote.
321 * Help and version messages are reorganized.
324 User-visible changes in version 2.6:
326 * New cmp, diff, diff3, sdiff option: --help
327 * A new heuristic for diff greatly reduces the time needed to compare
328 large input files that contain many differences.
329 * Partly as a result, GNU diff's output is not exactly the same as before.
330 Usually it is a bit smaller, but sometimes it is a bit larger.
333 User-visible changes in version 2.5:
335 * New cmp option: -v --version
338 User-visible changes in version 2.4:
340 * New cmp option: --ignore-initial=BYTES
341 * New diff3 option: -T --initial-tab
342 * New diff option: --line-format=FORMAT
343 * New diff group format specifications:
344 <PRINTF_SPEC>[eflmnEFLMN]
345 A printf spec followed by one of the following letters
346 causes the integer corresponding to that letter to be
347 printed according to the printf specification.
348 E.g. '%5df' prints the number of the first line in the
349 group in the old file using the "%5d" format.
350 e: line number just before the group in old file; equals f - 1
351 f: first line number in group in the old file
352 l: last line number in group in the old file
353 m: line number just after the group in old file; equals l + 1
354 n: number of lines in group in the old file; equals l - f + 1
355 E, F, L, M, N: likewise, for lines in the new file
357 If A equals B then T else E. A and B are each either a decimal
358 constant or a single letter interpreted as above. T and E are
359 arbitrary format strings. This format spec is equivalent to T if
360 A's value equals B's; otherwise it is equivalent to E. For
361 example, '%(N=0?no:%dN) line%(N=1?:s)' is equivalent to 'no lines'
362 if N (the number of lines in the group in the new file) is 0,
363 to '1 line' if N is 1, and to '%dN lines' otherwise.
365 where C is a single character, stands for the character C. C may not
366 be a backslash or an apostrophe. E.g. %c':' stands for a colon.
368 where O is a string of 1, 2, or 3 octal digits, stands for the
369 character with octal code O. E.g. %c'\0' stands for a null character.
370 * New diff line format specifications:
372 The line number, printed with <PRINTF_SPEC>.
373 E.g. '%5dn' prints the line number with a "%5d" format.
376 The character C, or with octal code O, as above.
377 * Supported <PRINTF_SPEC>s have the same meaning as with printf, but must
378 match the extended regular expression %-*[0-9]*(\.[0-9]*)?[doxX].
379 * The format spec %0 introduced in version 2.1 has been removed, since it
380 is incompatible with printf specs like %02d. To represent a null char,
382 * cmp and diff now conform to POSIX 1003.2-1992 (ISO/IEC 9945-2:1993)
383 if the underlying system conforms to POSIX:
384 - Some messages' wordings are changed in minor ways.
385 - "White space" is now whatever C's 'isspace' says it is.
386 - When comparing directories, if 'diff' finds a file that is not a regular
387 file or a directory, it reports the file's type instead of diffing it.
388 (As usual, it follows symbolic links first.)
389 - When signaled, sdiff exits with the signal's status, not with status 2.
390 * Now portable to hosts where int, long, pointer, etc. are not all the same
392 * 'cmp - -' now works like 'diff - -'.
395 User-visible changes in version 2.3:
397 * New diff option: --horizon-lines=lines
400 User-visible changes in version 2.1:
403 --{old,new,unchanged}-line-format='format'
404 --{old,new,unchanged,changed}-group-format='format'
408 * diff3 -m now defaults to -A, not -E.
409 * diff3 now takes up to three -L or --label options, not just two.
410 If just two options are given, they refer to the first two input files,
411 not the first and third input files.
412 * sdiff and diff -y handle incomplete lines.
415 User-visible changes in version 2.0:
417 * Add sdiff and cmp programs.
418 * Add Texinfo documentation.
419 * Add configure script.
420 * Improve diff performance.
424 -P --unidirectional-new-file
429 --suppress-common-lines
430 * diff options renamed:
431 --label renamed from --file-label
432 --forward-ed renamed from --reversed-ed
433 --paginate renamed from --print
434 --entire-new-file renamed from --entire-new-files
435 --new-file renamed from --new-files
439 * Add long-named equivalents for other diff3 options.
440 * diff options -F (--show-function-line) and -I (--ignore-matching-lines)
441 can now be given more than once.
445 Copyright (C) 1993-1994, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2021 Free
446 Software Foundation, Inc.
448 This file is part of GNU Diffutils.
450 This program is free software: you can redistribute it and/or modify
451 it under the terms of the GNU General Public License as published by
452 the Free Software Foundation, either version 3 of the License, or
453 (at your option) any later version.
455 This program is distributed in the hope that it will be useful,
456 but WITHOUT ANY WARRANTY; without even the implied warranty of
457 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
458 GNU General Public License for more details.
460 You should have received a copy of the GNU General Public License
461 along with this program. If not, see <http://www.gnu.org/licenses/>.