I'm afraid it's not that simple. The patch will cause diff3 to output that warning, since diff3 uses diff without --normal, so diff3.c needs fixing. Also, the manual needs fixing (doc/diffutils.texi). And the output of "diff --help" (src/diff.c). And there should be a test case testing the new behavior.

More important. Suppose I want a program with GNU diff's traditional behavior and so use a shell script 'mydiff' like this:

  #!/bin/sh
  exec diff --normal "$@"

This won't work, because if I invoke the script like this:

  mydiff -c foo bar

diff will complain about --normal conflicting with -c. So I suppose diff needs to change so that later output specifiers override earlier. But here things are a bit tricky, e.g., right now '-C5 -c' is equivalent to '-c -C5' and I assume we don't want to change this.

One other idea. If the invoker uses any long option, or any option other than -b and -r, diff can default to the -u output format regardless of whether POSIXLY_CORRECT is set. This is because POSIX does not specify the behavior of these other options.

Plus, it would be nice if we could address Eric's concerns somehow.

I hope I haven't scared you away entirely....



Reply via email to