Imported Upstream version 3.8
[platform/upstream/diffutils.git] / NEWS
1 GNU diffutils NEWS                                    -*- outline -*-
2
3 * Noteworthy changes in release 3.8 (2021-08-01) [stable]
4
5 ** Incompatible changes
6
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]
13
14 ** Bug fixes
15
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"]
21
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]
25
26
27 * Noteworthy changes in release 3.7 (2018-12-31) [stable]
28
29 ** Bug fixes
30
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]
35
36 ** Improvements
37
38   diff --color now produces output compatible with less -R.
39
40
41 * Noteworthy changes in release 3.6 (2017-05-21) [stable]
42
43 ** New features
44
45   When one file is a prefix of the other, cmp now appends the shorter
46   file's size to the EOF diagnostic.
47
48 ** Bug fixes
49
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]
55
56   diff no longer mishandles line numbers exceeding 2**31 on Mingw-w64.
57
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]
61
62 ** Performance changes
63
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.
66
67
68 * Noteworthy changes in release 3.5 (2016-08-20) [stable]
69
70 ** Bug fixes
71
72   diff3 no longer malfunctions due to use-after-free
73   [bug introduced in 3.4]
74
75   diff --color no longer colorizes when TERM=dumb
76
77
78 * Noteworthy changes in release 3.4 (2016-08-08) [stable]
79
80 ** New features
81
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.
86
87 ** Bug fixes
88
89   When binary files differ, diff now exits with status 1 as POSIX requires.
90   Formerly it exited with status 2.
91
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.
97
98   diff -B no longer generates incorrect output if the two inputs
99   each end with a one-byte incomplete line.
100
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
107
108 ** Performance changes
109
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).
113
114
115 * Noteworthy changes in release 3.3 (2013-03-24) [stable]
116
117 ** New features
118
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.
124
125   --new-file (-N) and --unidirectional-new-file now allow comparisons to "-".
126   A standard input that's closed acts like a nonexistent file.
127
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.
132
133 ** Packaging
134
135   diffutils is now designed to build with Cygwin or MinGW rather than DJGPP.
136   The ms subdirectory has been removed.
137
138
139 * Noteworthy changes in release 3.2 (2011-09-02) [stable]
140
141 ** Changes in behavior
142
143   --ignore-file-name-case now applies at the top level too.
144   For example, "diff dir inIt" might compare "dir/Init" to "inIt".
145
146 ** New features
147
148   diff and sdiff have a new option --ignore-trailing-space (-Z).
149
150 ** Packaging
151
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.
154
155
156 * Noteworthy changes in release 3.1 (2011-08-10) [stable]
157
158 ** Bug fixes
159
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.
163
164 * Noteworthy changes in release 3.0 (2010-05-03) [stable]
165
166 ** Bug fixes
167
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]
172
173 ** Changes in behavior
174
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.
181
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".
186
187
188 * Noteworthy changes in release 2.9 (2010-02-11) [stable]
189
190 ** New features
191
192   New diff option --suppress-blank-empty.
193
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.
199
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>.
204
205   sdiff now understands '1' and '2' as synonyms for 'l' and 'r'.
206
207 ** Changes in behavior
208
209   sdiff and diff3 now invoke diff, not $(bindir)/diff
210
211 ** Administrivia
212
213   New discussion and bug-reporting address: bug-diffutils@gnu.org
214
215   updated gnulib support
216
217
218 * Noteworthy changes in release 2.8.7 (2004-04-13) [stable]
219
220   Version 2.8.7 contains no user-visible changes.
221
222 User-visible changes in version 2.8.6:
223
224 * New diff3 option --strip-trailing-cr.
225
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.
229
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.
232
233 * diff now omits the ".000000000" on hosts that do not support
234   fractional timestamps.
235
236 Version 2.8.5 was not publicly released.
237
238 User-visible changes in version 2.8.4:
239
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.
245
246 User-visible changes in version 2.8.3:
247
248 * New locale: en_US.
249
250 User-visible changes in version 2.8.2:
251
252 * New diff and sdiff option:
253   --tabsize=COLUMNS
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
256   only white space.
257 * More platforms now handle multibyte characters correctly when
258   excluding files by name (diff -x and -X).
259 * New locales: hu, pt_BR.
260
261 User-visible changes in version 2.8.1:
262
263 * Documentation fixes.
264
265 User-visible changes in version 2.8:
266
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
286   --strip-trailing-cr
287 * New diff options:
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.*.
314
315
316 User-visible changes in version 2.7:
317
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.
322
323
324 User-visible changes in version 2.6:
325
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.
331
332
333 User-visible changes in version 2.5:
334
335 * New cmp option: -v --version
336
337
338 User-visible changes in version 2.4:
339
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
356   %(A=B?T:E)
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.
364   %c'C'
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.
367   %c'\O'
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:
371   <PRINTF_SPEC>n
372       The line number, printed with <PRINTF_SPEC>.
373       E.g. '%5dn' prints the line number with a "%5d" format.
374   %c'C'
375   %c'\O'
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,
381   use %c'\0' instead.
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
391   size.
392 * 'cmp - -' now works like 'diff - -'.
393
394
395 User-visible changes in version 2.3:
396
397 * New diff option: --horizon-lines=lines
398
399
400 User-visible changes in version 2.1:
401
402 * New diff options:
403   --{old,new,unchanged}-line-format='format'
404   --{old,new,unchanged,changed}-group-format='format'
405   -U
406 * New diff3 option:
407   -A --show-all
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.
413
414
415 User-visible changes in version 2.0:
416
417 * Add sdiff and cmp programs.
418 * Add Texinfo documentation.
419 * Add configure script.
420 * Improve diff performance.
421 * New diff options:
422 -x --exclude
423 -X --exclude-from
424 -P --unidirectional-new-file
425 -W --width
426 -y --side-by-side
427 --left-column
428 --sdiff-merge-assist
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
436 --all-text removed
437 * New diff3 options:
438 -v --version
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.
442
443 \f
444
445 Copyright (C) 1993-1994, 1998, 2001-2002, 2004, 2006, 2009-2013, 2015-2021 Free
446 Software Foundation, Inc.
447
448 This file is part of GNU Diffutils.
449
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.
454
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.
459
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/>.