kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Need help: Generating patch using git
@ 2012-01-30 17:21 amit mehta
  2012-01-30 17:27 ` Subramaniam Appadodharana
  2012-01-30 17:32 ` Srivatsa Bhat
  0 siblings, 2 replies; 13+ messages in thread
From: amit mehta @ 2012-01-30 17:21 UTC (permalink / raw)
  To: kernelnewbies

Hi,

kernel janitors group seem like a good place to start learning linux kernel and
after reading some of the information available on kernel newbies website, i
tried to generate a dummy patch and need your help for moving in correct
direction of learning and contributing to linux kernel. So these are
the steps that i've followed to generate this dummy patch.

1: Download the latest linux kernel sources using git
# mkdir linux-next
# cd linux-next
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
linux-2.6

2: Do some modifications.
# pwd
/root/linux-next/linux-2.6

# git diff
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 6e412a6..9858701 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -441,7 +441,7 @@ static int __init ic_defaults(void)
                                &ic_myaddr);
                        return -1;
                }
-               printk("IP-Config: Guessing netmask %pI4\n", &ic_netmask);
+               printk(KERN_INFO "IP-Config: Guessing netmask %pI4\n",
&ic_netmask);
        }

        return 0;

3: Generate a patch
# pwd
/root/linux-next/linux-2.6
# mkdir ../patches
# git diff >../patches/ipconfigPatch.txt

4: Test your patch
4a: Clear the local changes from the tree
# git checkout -f

4b: Apply the patch
# git apply ../patches/ipconfigPatch.txt


The above step(4b) did not returned any git error so it seems to me that the
steps to generate this patch was correct.

5: Check your mailer
5a: I just copied the contents of ../patches/ipconfigPatch.txt and pasted in
the compose area and sent that mail to myself. After receiving this mail i
copied and pasted the mail contents in a file under
/root/linux-next/patches/dummyPatch.txt and tried to apply this patch
using git but it gave me an error as below:
# git apply ../patches/dummy.txt
fatal: corrupt patch at line 11

Hence it seems i'm missing something here. Please note that this is just for my
understanding purpose of generating and submitting patches.

-Amit

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-03-08  7:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-30 17:21 Need help: Generating patch using git amit mehta
2012-01-30 17:27 ` Subramaniam Appadodharana
2012-01-30 17:32 ` Srivatsa Bhat
2012-01-30 18:33   ` amit mehta
2012-01-31 21:39     ` Julie Sullivan
2012-02-01  5:21       ` amit mehta
2012-02-01 21:01         ` Julie Sullivan
2012-03-05 20:48           ` Amit Mehta
2012-03-07 21:58             ` Julie Sullivan
2012-03-08  7:46               ` amit mehta
2012-02-01 21:17         ` Srivatsa Bhat
2012-02-01 22:05           ` Greg KH
2012-02-01 22:12             ` Srivatsa Bhat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).