2005-03-05 20:50:40

by Bodo Eggert

[permalink] [raw]
Subject: [PATCH] Re: diff command line?

Russell King <[email protected]> wrote:
> On Sat, Mar 05, 2005 at 10:48:00AM -0500, Gene Heskett wrote:

>> What are the options normally used to generate a diff for public
>> consumption on this list?
>
> diff -urpN orig new
>
> where "orig" and "new" both contain the top level "linux" directory,
> so the resulting patch can be applied with patch -p1.

This seems to be a common mistake.

Signed-Off-By: Bodo Eggert <[email protected]>

--- linux-2.6.11/Documentation/SubmittingPatches.ori 2005-03-05
21:29:26.000000000 +0100
+++ linux-2.6.11/Documentation/SubmittingPatches 2005-03-05
21:38:40.000000000 +0100
@@ -24,6 +24,7 @@ SECTION 1 - CREATING AND SENDING YOUR CH
------------

Use "diff -up" or "diff -uprN" to create patches.
+The resulting patch must apply with -p1 from within the linux directory.

All changes to the Linux kernel occur in the form of patches, as
generated by diff(1). When creating your patch, make sure to create it


2005-03-05 21:14:07

by Willy Tarreau

[permalink] [raw]
Subject: Re: [PATCH] Re: diff command line?

On Sat, Mar 05, 2005 at 09:47:44PM +0100, Bodo Eggert wrote:
> Russell King <[email protected]> wrote:
> > On Sat, Mar 05, 2005 at 10:48:00AM -0500, Gene Heskett wrote:
>
> >> What are the options normally used to generate a diff for public
> >> consumption on this list?
> >
> > diff -urpN orig new
> >
> > where "orig" and "new" both contain the top level "linux" directory,
> > so the resulting patch can be applied with patch -p1.
>
> This seems to be a common mistake.

I often use a simple trick to make my single file patches compatible
with both -p0 and -p1 :

diff -pruN ./dir/file.orig ./dir/file.new

The './' can either get stripped by -p1 or left as is, thus the patch
works for different scripts or people. The main disadvantage is that
there's no base version indication in the patch with this method.

Regards,
Willy

2005-03-05 21:53:17

by Gene Heskett

[permalink] [raw]
Subject: Re: [PATCH] Re: diff command line?

On Saturday 05 March 2005 16:08, Willy Tarreau wrote:
>On Sat, Mar 05, 2005 at 09:47:44PM +0100, Bodo Eggert wrote:
>> Russell King <[email protected]> wrote:
>> > On Sat, Mar 05, 2005 at 10:48:00AM -0500, Gene Heskett wrote:
>> >> What are the options normally used to generate a diff for
>> >> public consumption on this list?
>> >
>> > diff -urpN orig new
>> >
>> > where "orig" and "new" both contain the top level "linux"
>> > directory, so the resulting patch can be applied with patch -p1.
>>
>> This seems to be a common mistake.
>
>I often use a simple trick to make my single file patches compatible
>with both -p0 and -p1 :
>
>diff -pruN ./dir/file.orig ./dir/file.new
>
>The './' can either get stripped by -p1 or left as is, thus the
> patch works for different scripts or people. The main disadvantage
> is that there's no base version indication in the patch with this
> method.
>
>Regards,
>Willy

Neat, Willy. Are such patches generally acceptable here?

--
Cheers, Gene
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.34% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attorneys please note, additions to this message
by Gene Heskett are:
Copyright 2005 by Maurice Eugene Heskett, all rights reserved.