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