Re: bad patches (was: Patches vs complete tarballs....)

Albert D. Cahalan (acahalan@cs.uml.edu)
Thu, 13 Aug 1998 03:47:10 -0400 (EDT)


Shawn Leas writes:
> On Wed, 12 Aug 1998, Albert D. Cahalan wrote:

>> If the recipient is supposed to use the -pN option, do not
>> send output that looks like this:
>>
>> diff -Naur v2.0.29/prog/README prog/README
>> --- v2.0.29/prog/README Mon Mar 10 15:13:12 1997
>> +++ prog/README Mon Mar 17 14:58:22 1997
>>
>> because the two file names have different numbers of
>> slashes, and different versions of patch interpret the
>> file names differently. To avoid confusion, send output
>> that looks like this instead:
>>
>> diff -Naur v2.0.29/prog/README v2.0.30/prog/README
>> --- v2.0.29/prog/README Mon Mar 10 15:13:12 1997
>> +++ v2.0.30/prog/README Mon Mar 17 14:58:22 1997
>>
>> --------------
>>
>> The "bad" example looks almost like a kernel patch, including an
>> oddly familiar version number. Hmmm, perhaps it is a hint?
>
> Notice the prog dir is inside a seperate subdir, but kernel patches
> simply have a ver appended to a dir. This is OK.

No, look:

diff -u --recursive --new-file v2.1.114/linux/CREDITS linux/CREDITS
--- v2.1.114/linux/CREDITS Tue Jul 21 00:15:29 1998
+++ linux/CREDITS Thu Aug 6 11:13:43 1998

Count the number of slashes in each name. You will see that they are
not the same, which is bad. Patching results will vary with the version
of the patch program that you use.

Good: 1/2/3/4/foo.c paired with a/b/c/d/foo.c
Bad: 1/2/3/4/foo.c paired with x/y/z/foo.c

Fixed header:

diff -u --recursive --new-file v2.1.114/linux/CREDITS v2.1.115/linux/CREDITS
--- v2.1.114/linux/CREDITS Tue Jul 21 00:15:29 1998
+++ v2.1.115/linux/CREDITS Thu Aug 6 11:13:43 1998

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html