Hi all,
This is not too serious of a bug, since "diff" still makes an appropriate "patch" file that "patch -p0" will properly use to correctly patch a file.
However, the Terminal output from "diff -s" is incorrect! So if you are just reading the results of "diff -s" on the Terminal, it will inform you that two different files are in fact "identical" --- this is an error in reporting the results of "diff -s" on the Terminal, and NOT an actual error of "diff -u" preparing an incorrect "patch" file when the two files differ. In summary, "diff -u/patch -p0" works correctly, but "diff -s" will report that two different file "are identical" on the Terminal line.
I'm using "/bin/bash" instead of "bin/zsh" (because I've found that some of my bash scripts do not run property when executed under zsh even though my scripts specify that /bin/bash should be used).
This reporting error is on an M3 Max MBP running Sonoma 14.1.1. I also checked an Intel MBP running Sonoma 14.1.1 and found the same reporting problem; however, on an old Intel MBP running Big Sur 11.6.2 this reporting error does not occur --- that is, under Big Sur "diff -s" does the proper thing and does NOT report that two different files "are identical" the way Sonoma does.
Solouki
P.S. And yes, I have send a bug report to Apple. I use diff/patch all the time, so thank goodness this still works correctly -- I just didn't want anybody to get "caught" thinking two files were the same because "diff -s" reports that the files are identical when in fact they are different.
Edit: I also checked an old MBP running Mavericks 12.7.1 and found that "diff -s" works properly unlike under Sonoma 14.1.1.
Edit 2: I have now checked Sonoma 14.1.2, and this reporting error still exists in it.
This is not too serious of a bug, since "diff" still makes an appropriate "patch" file that "patch -p0" will properly use to correctly patch a file.
However, the Terminal output from "diff -s" is incorrect! So if you are just reading the results of "diff -s" on the Terminal, it will inform you that two different files are in fact "identical" --- this is an error in reporting the results of "diff -s" on the Terminal, and NOT an actual error of "diff -u" preparing an incorrect "patch" file when the two files differ. In summary, "diff -u/patch -p0" works correctly, but "diff -s" will report that two different file "are identical" on the Terminal line.
I'm using "/bin/bash" instead of "bin/zsh" (because I've found that some of my bash scripts do not run property when executed under zsh even though my scripts specify that /bin/bash should be used).
This reporting error is on an M3 Max MBP running Sonoma 14.1.1. I also checked an Intel MBP running Sonoma 14.1.1 and found the same reporting problem; however, on an old Intel MBP running Big Sur 11.6.2 this reporting error does not occur --- that is, under Big Sur "diff -s" does the proper thing and does NOT report that two different files "are identical" the way Sonoma does.
Solouki
P.S. And yes, I have send a bug report to Apple. I use diff/patch all the time, so thank goodness this still works correctly -- I just didn't want anybody to get "caught" thinking two files were the same because "diff -s" reports that the files are identical when in fact they are different.
Edit: I also checked an old MBP running Mavericks 12.7.1 and found that "diff -s" works properly unlike under Sonoma 14.1.1.
Edit 2: I have now checked Sonoma 14.1.2, and this reporting error still exists in it.
Last edited: