Adding patches through git

From WebOS Internals
Revision as of 23:51, 22 April 2010 by Sbromwich (talk | contribs)
Jump to navigation Jump to search

Add patches to be committed to the Preware feed by following this guide.


  • SSH key generated, with the authorised for commital on (rhwitby is able to do this)
  • GPL compliant patch to submit

Initialising your local repository

  • You will need to pull down the kernel/patches repository as a starting point with

<source lang="text">git clone</source>

A worked example is as follows:

<source lang="text"> mason~/kernels$ git clone Initialized empty Git repository in /home/sbromwich/kernels/patches/.git/ Enter passphrase for key '/home/sbromwich/.ssh/id_dsa': remote: Counting objects: 70, done. remote: Compressing objects: 100% (68/68), done. remote: Total 70 (delta 23), reused 0 (delta 0) Receiving objects: 100% (70/70), 15.21 KiB, done. Resolving deltas: 100% (23/23), done. mason~/kernels$ ls patches mason~/kernels$ ls -l total 4 drwxr-xr-x 5 sbromwich sbromwich 4096 Apr 22 22:17 patches mason~/kernels$ cd patches/ mason~/kernels/patches$ ls LICENSE overclocking sensors mason~/kernels/patches$ ls -l total 12 -rw-r--r-- 1 sbromwich sbromwich 88 Apr 22 22:17 LICENSE drwxr-xr-x 2 sbromwich sbromwich 4096 Apr 22 22:17 overclocking drwxr-xr-x 2 sbromwich sbromwich 4096 Apr 22 22:17 sensors mason~/kernels/patches$ </source>

  • Create a directory for your patch(es) and copy them in there.

Tag patches and submit to git

  • Find the next available git tag with

<source lang="text">git -l</source>

In the following case, the next tag is v1.4.1-10:

<source lang="text"> mason~/kernels/patches/prcm$ git tag -l v1.4.0-0 v1.4.0-1 v1.4.1-1 v1.4.1-2 v1.4.1-3 v1.4.1-4 v1.4.1-5 v1.4.1-6 v1.4.1-7 v1.4.1-8 v1.4.1-9 mason~/kernels/patches/prcm$ </source>

  • Tag the files with a meaningful commit message and the tag from the previous step:

<source lang="text"> mason~/kernels/patches/prcm$ git tag -a -m "PRCM resume from suspend fix/kludge" v1.4.1-10 mason~/kernels/patches/prcm$ </source>

  • Send the tagged files to the upstream repository with

<source lang="text">git push ; git push --tags</source>

For example:

<source lang="text"> mason~/kernels/patches/prcm$ git push ; git push --tags Enter passphrase for key '/home/sbromwich/.ssh/id_dsa': Everything up-to-date Enter passphrase for key '/home/sbromwich/.ssh/id_dsa': Counting objects: 1, done. Writing objects: 100% (1/1), 187 bytes, done. Total 1 (delta 0), reused 0 (delta 0) To

* [new tag]         v1.4.1-10 -> v1.4.1-10

mason~/kernels/patches/prcm$ </source>