mkpatch and diff
Hi all,
In the mkpatch.pl scripts, we use "diff -u2" to generate the diffs. Since this option is deprecated and it should be "diff -U 2", I was about to update this line, and wondered why this option was in use.
I tested without this option and the patch is actually *smaller* than when using only two lines of context (242846 bytes with the option, 210144 without it). The only reason I can see is that it might help using the patch on a different version of the Linux kernel than the one that was used as a base. But since one can always regenerate the patch for its own tree, I don't really see the interest. And I'm not even sure it really helps. Less contexts also means more risks to patch in the wrong place.
So I plan to simply remove that option. Any objection anyone?
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
(Replying to myself...)
Quoted 7 lines
In the mkpatch.pl scripts, we use "diff -u2" to generate the diffs. Since this option is deprecated and it should be "diff -U 2", I was about to update this line, and wondered why this option was in use.
I tested without this option and the patch is actually *smaller* than when using only two lines of context (242846 bytes with the option, 210144 without it).
I have to correct what I said here. The size I give here is with no option at all, but this produces a non-unified diff, so this is rather useless. A unified diff with 3 lines of context is bigger (257616 bytes), as expected.
Quoted 3 lines
The only reason I can see is that it might help
using the patch on a different version of the Linux kernel than the one that was used as a base.
I have to correct this too. If more context exists, patch is still able to ignore the lines that would cause the operation to fail. So, size left apart, there is no benefit specifying a smaller "u" value for diff.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Jean,
After removing my CVS version of i2c and lm_sensors2, I redownloaded them and patched my kernel. This worked perfectly.
Troy