Skip to contentSkip to conversation

Documentation/SubmittingPatches

PATCH In review Bryan Whitehead 6 participants 6 messages Feb 5, 2004 – Feb 6, 2004 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation/SubmittingPatches

I've been trying to get my feet wet by submitting trivial patchs to various maintainers and the responses have been, "your not submiting you patches correctly". It seems most developers/maintainers want a diff done like this:

cd /source-tree
diff -u linux-2.6.2/FileToPatch.orig linux-2.6.2/FileToPatch

instead of the "SubmitingPatches" document way:
cd /source-tree/linux-2.6.2
diff -u FileToPatch.orig FileToPatch

It would be _great_ if the Documentation was more accurate to the taste of developers/maintainers...

If the SubmittingPatches document is correct, then just toss this patch out because this won't be submitted right... ;)

Documentation/SubmittingPatches 2004-02-04 23:01:28.799185040 -0800 renamed from Documentation/SubmittingPatches.orig 2004-02-04 22:57:55.818563016 -0800 +5 -3
@@ -33,13 +33,15 @@
                                                                                                                                    
 To create a patch for a single file, it is often sufficient to do:
                                                                                                                                    
-       SRCTREE= /devel/linux-2.4
+       SRCTREE= /devel/
+       SRCDIR= linux-2.4
        MYFILE=  drivers/net/mydriver.c
                                                                                                                                    
-       cd $SRCTREE
+       cd $SRCTREE/$SRCDIR
        cp $MYFILE $MYFILE.orig
        vi $MYFILE      # make your change
-       diff -u $MYFILE.orig $MYFILE > /tmp/patch
+       cd $SRCTREE
+       diff -u $SRCDIR/$MYFILE.orig $SRCDIR/$MYFILE > /tmp/patch
                                                                                                                                    
 To create a patch for multiple files, you should unpack a "vanilla",
 or unmodified kernel source tree, and generate a diff against your
Signature · 3 lines
Bryan Whitehead
Email:[email protected]
WorkE:[email protected]
#1 lore raw

Hi Bryan.

Quoted 8 lines

I've been trying to get my feet wet by submitting trivial patches to various maintainers and the responses have been, "you're not submitting you patches correctly". It seems most developers/maintainers want a diff done like this:

cd /source-tree
diff -u linux-2.6.2/FileToPatch.orig linux-2.6.2/FileToPatch

Quoted 7 lines

instead of the "SubmitingPatches" document way:

cd /source-tree/linux-2.6.2
diff -u FileToPatch.orig FileToPatch

It would be _great_ if the Documentation was more accurate to the taste of developers/maintainers...

Obviously, I can't speak for the rest of the developers, but my personal stance has always been this: If I can identify both the kernel version the patch is against and where in the source tree is being patched, I will apply the patch. If not, I won't.

I suspect the change you note is due to the number of people who submit patches within a directory in the source tree that don't indicate either of the above facts. If the answers aren't obvious from the email, I run find -name ${FILE} from the root directory of the current source tree and if there's not more than three possibilities for the file, I will try patching each of them to see whether the patch will apply to any of them. Beyond that, I want further information from the submitter.

One other thing I've found useful is to increase the context given in the diff by using -u5 rather than just -u as that considerably increases the chances of a successful patch when other patches have already been applied. However, that's very much personal preference and probably not shared by other developers.

As an example, if somebody sends me a patch that tweaks a file called Makefile with no indication of either of the above - well, let's just say I've better things to do with my time than to search through the various files of that name in the various kernel source trees to identify the correct one...

Best wishes from Riley.
---
* Nothing as pretty as a smile, nothing as ugly as a frown.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 30-Jan-2004

#2 lore raw
In reply to Bryan Whitehead
Quoted 22 lines · Bryan Whitehead

I've been trying to get my feet wet by submitting trivial patchs to various maintainers and the responses have been, "your not submiting you patches correctly". It seems most developers/maintainers want a diff done like this:

cd /source-tree
diff -u linux-2.6.2/FileToPatch.orig linux-2.6.2/FileToPatch

instead of the "SubmitingPatches" document way:
cd /source-tree/linux-2.6.2
diff -u FileToPatch.orig FileToPatch

It would be _great_ if the Documentation was more accurate to the taste of developers/maintainers...

If the SubmittingPatches document is correct, then just toss this patch out because this won't be submitted right... ;)

Documentation/SubmittingPatches 2004-02-04 23:01:28.799185040 -0800 line 38

Quoted 7 lines
Documentation/SubmittingPatches 2004-02-04 23:01:28.799185040 -0800 renamed from Documentation/SubmittingPatches.orig 2004-02-04 22:57:55.818563016 -0800 +2 -1
@@ -33,13 +33,15 @@
 
 To create a patch for a single file, it is often sufficient to do:
 
-       SRCTREE= /devel/linux-2.4
+       SRCTREE= /devel/
+       SRCDIR= linux-2.4
        MYFILE=  drivers/net/mydriver.c

Might as well change this to `linux-2.6' altogether.

Arthur

#3 lore raw
In reply to Bryan Whitehead
Quoted 23 lines · Bryan Whitehead

I've been trying to get my feet wet by submitting trivial patchs to various maintainers and the responses have been, "your not submiting you patches correctly". It seems most developers/maintainers want a diff done like this:

cd /source-tree
diff -u linux-2.6.2/FileToPatch.orig linux-2.6.2/FileToPatch

instead of the "SubmitingPatches" document way:
cd /source-tree/linux-2.6.2
diff -u FileToPatch.orig FileToPatch

It would be _great_ if the Documentation was more accurate to the taste of developers/maintainers...

If the SubmittingPatches document is correct, then just toss this patch out because this won't be submitted right... ;)

Documentation/SubmittingPatches 2004-02-04 23:01:28.799185040 -0800 renamed from Documentation/SubmittingPatches.orig 2004-02-04 22:57:55.818563016 -0800 +2 -1
@@ -33,13 +33,15 @@
 
 To create a patch for a single file, it is often sufficient to do:
 
-       SRCTREE= /devel/linux-2.4
+       SRCTREE= /devel/
+       SRCDIR= linux-2.4

Documentation/SubmittingPatches 2004-02-04 23:01:28.799185040 -0800 line 45

Quoted 10 lines
Documentation/SubmittingPatches 2004-02-04 23:01:28.799185040 -0800 renamed from Documentation/SubmittingPatches.orig 2004-02-04 22:57:55.818563016 -0800 +3 -2
        MYFILE=  drivers/net/mydriver.c
 
-       cd $SRCTREE
+       cd $SRCTREE/$SRCDIR
        cp $MYFILE $MYFILE.orig
        vi $MYFILE      # make your change
-       diff -u $MYFILE.orig $MYFILE > /tmp/patch
+       cd $SRCTREE
+       diff -u $SRCDIR/$MYFILE.orig $SRCDIR/$MYFILE > /tmp/patch
 

For what it may be worth I find patches a lot more useful for review purposes if the -p (for --show-c-function) option is also used.

Signature · 5 lines
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		[email protected]

		Remember Cernan and Schmitt
#4 lore raw

On Thu, 5 Feb 2004 19:45:09 -0800 jw schultz <[email protected]> wrote:

| On Wed, Feb 04, 2004 at 11:23:03PM -0800, Bryan Whitehead wrote:
| > 
| > I've been trying to get my feet wet by submitting trivial patchs to various maintainers and the responses have been, "your not submiting you patches correctly". It seems most developers/maintainers want a diff done like this:
| > 
| > cd /source-tree
| > diff -u linux-2.6.2/FileToPatch.orig linux-2.6.2/FileToPatch
| > 
| > instead of the "SubmitingPatches" document way:
| > cd /source-tree/linux-2.6.2
| > diff -u FileToPatch.orig FileToPatch
| > 
| > It would be _great_ if the Documentation was more accurate to the taste of developers/maintainers...
| > 
| > If the SubmittingPatches document is correct, then just toss this patch out because this won't be submitted right... ;)
| > 
| > --- linux-2.6.2/Documentation/SubmittingPatches.orig    2004-02-04 22:57:55.818563016 -0800
| > +++ linux-2.6.2/Documentation/SubmittingPatches 2004-02-04 23:01:28.799185040 -0800
| > @@ -33,13 +33,15 @@
| >                                                                                                                                     
| >  To create a patch for a single file, it is often sufficient to do:
| >                                                                                                                                     
| > -       SRCTREE= /devel/linux-2.4
| > +       SRCTREE= /devel/
| > +       SRCDIR= linux-2.4
| >         MYFILE=  drivers/net/mydriver.c
| >                                                                                                                                     
| > -       cd $SRCTREE
| > +       cd $SRCTREE/$SRCDIR
| >         cp $MYFILE $MYFILE.orig
| >         vi $MYFILE      # make your change
| > -       diff -u $MYFILE.orig $MYFILE > /tmp/patch
| > +       cd $SRCTREE
| > +       diff -u $SRCDIR/$MYFILE.orig $SRCDIR/$MYFILE > /tmp/patch
| >                                                                                                                                     
| 
| For what it may be worth I find patches a lot more useful
| for review purposes if the -p (for --show-c-function) option
| is also used.

and which was recently added to SubmittingPatches .

But this should all get cleaned up...

--
~Randy

#5 lore raw
Quoted 8 lines · On Thu, 5 Feb 2004 19:45:09 -0800 jw schultz <[email protected]> wrote:

It would be _great_ if the Documentation was more accurate to the taste of developers/maintainers...

| > --- linux-2.6.2/Documentation/SubmittingPatches.orig    2004-02-04 22:57:55.818563016 -0800
| > +++ linux-2.6.2/Documentation/SubmittingPatches 2004-02-04 23:01:28.799185040 -0800
| > @@ -33,13 +33,15 @@

I thought the preferred method was:

--- linux-2.6.2.orig/Documentation/SubmittingPatches +++ linux-2.6.2/Documentation/SubmittingPatches

In other words, I always thought you should have a whole parallel original tree. This more nicely captures multi-file changes, IMHO, and I've seen this a great deal.

=============================
Tim Bird
Architecture Group Co-Chair
CE Linux Forum
Senior Staff Engineer
Sony Electronics
E-mail: [email protected]
=============================