[PATCH] Fix Documentation/SubmittingPatches to use -p

From: Martin J. Bligh (mbligh_at_aracnet.com)
Date: 01/09/04

  • Next message: Ramon Rey Vicente: "[2.6.1-rc2-mm1][BUG] kernel BUG at mm/rmap.c:305!"
    Date:	Thu, 08 Jan 2004 15:42:58 -0800
    To: Andrew Morton <akpm@osdl.org>
    
    

    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.

    diff -aurpN -X /home/fletch/.diff.exclude virgin/Documentation/SubmittingPatches SubPatch/Documentation/SubmittingPatches
    --- virgin/Documentation/SubmittingPatches Tue Aug 5 19:59:11 2003
    +++ SubPatch/Documentation/SubmittingPatches Thu Jan 8 15:40:08 2004
    @@ -20,16 +20,18 @@ SECTION 1 - CREATING AND SENDING YOUR CH
     
     
     
    -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
             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

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Ramon Rey Vicente: "[2.6.1-rc2-mm1][BUG] kernel BUG at mm/rmap.c:305!"

    Relevant Pages

    • [PATCH][CFT] mm swapping improvements
      ... Nikita's patches and one of my own, and backs out the RSS limit patch ... diff -puN include/linux/mmzone.h~rollup include/linux/mmzone.h ... -int FASTCALL); ...
      (Linux-Kernel)
    • Re: Creating patches for source
      ... I'm starting to create patches (diff) ... what command will make the cleanest patch and which ... the full content and then create the file when patching the source? ...
      (Linux-Kernel)
    • Re: troubles patching kernel source
      ... > I'm trying to make some patches that can apply to the kernel source. ... I always use -p1 inside the tree to patch. ... > when running diff to make the patchfile. ...
      (comp.os.linux.development.system)
    • Re: Documentation - how to apply patches for various trees
      ... >> explanation of the various kernel trees and how to apply their patches. ... +a patch to the kernel or, more specifically, what base kernel a patch for ... +kernel source directories it was generated against. ...
      (Linux-Kernel)
    • Re: Documentation - how to apply patches for various trees
      ... > +and what new version the patch will change the source tree into. ... This is usurally not true for kernel patches, ... > +patch file contain the name of the kernel source directories it was ...
      (Linux-Kernel)