]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix Documentation/SubmittingPatches to use -p
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 13:11:05 +0000 (05:11 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 13:11:05 +0000 (05:11 -0800)
From: "Martin J. Bligh" <mbligh@aracnet.com>

Patches are a damned sight easier to read if people use the '-p'
option to diff ... this generates output that looks like this:

 "@@ -323,6 +323,7 @@ void put_dirty_page(struct task_struct *"

for each block. This patch simply adds that to the documentation
file, in the hope of steering new users in the right direction.

Documentation/SubmittingPatches

index 029e4281aa7755b3eec2b006daf552088d50a80c..c08521ba749ea6d3ee452754a01e7f6af65b7f61 100644 (file)
@@ -20,16 +20,18 @@ SECTION 1 - CREATING AND SENDING YOUR CHANGE
 
 
 
-1) "diff -u"
+1) "diff -up"
 ------------
 
-Use "diff -u" or "diff -urN" to create patches.
+Use "diff -up" or "diff -uprN" to create patches.
 
 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
 in "unified diff" format, as supplied by the '-u' argument to diff(1).
-Patches should be based in the root kernel source directory, not in
-any lower subdirectory.
+Also, please use the '-p' argument which shows which C function each
+change is in - that makes the resultant diff a lot easier to read.
+Patches should be based in the root kernel source directory,
+not in any lower subdirectory.
 
 To create a patch for a single file, it is often sufficient to do:
 
@@ -39,7 +41,7 @@ To create a patch for a single file, it is often sufficient to do:
        cd $SRCTREE
        cp $MYFILE $MYFILE.orig
        vi $MYFILE      # make your change
-       diff -u $MYFILE.orig $MYFILE > /tmp/patch
+       diff -up $MYFILE.orig $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
@@ -50,7 +52,7 @@ own source tree.  For example:
        tar xvfz linux-2.4.0-test11.tar.gz
        mv linux linux-vanilla
        wget http://www.moses.uklinux.net/patches/dontdiff
-       diff -urN -X dontdiff linux-vanilla $MYSRC > /tmp/patch
+       diff -uprN -X dontdiff linux-vanilla $MYSRC > /tmp/patch
        rm -f dontdiff
 
 "dontdiff" is a list of files which are generated by the kernel during