Debian Codegraph @

NEWS

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