From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266384AbUAHXnW (ORCPT ); Thu, 8 Jan 2004 18:43:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266383AbUAHXnV (ORCPT ); Thu, 8 Jan 2004 18:43:21 -0500 Received: from obsidian.spiritone.com ([216.99.193.137]:31884 "EHLO obsidian.spiritone.com") by vger.kernel.org with ESMTP id S266379AbUAHXnD (ORCPT ); Thu, 8 Jan 2004 18:43:03 -0500 Date: Thu, 08 Jan 2004 15:42:58 -0800 From: "Martin J. Bligh" To: Andrew Morton cc: linux-kernel Subject: [PATCH] Fix Documentation/SubmittingPatches to use -p Message-ID: <6550000.1073605378@[10.10.2.4]> X-Mailer: Mulberry/2.2.1 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.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