<> <> = Creating a Patch = A patch is really just a textfile which contains a collection of lines to be added or substracted to/from other textfiles. == Create Patch From a git Cherry Pick == [[http://en.wikipedia.org/wiki/Git_%28software%29|git]] is a source code management tool, which is becoming more and more popular. Creating a patch from a git repo is quite easy, if you know which commit(s) you are looking for. If you know which commit includes the changes you are interested of, for instance ''886600b5a2baa0c88f4d709dbc6ab0896e6565cb'', in the root of the git source, do: ||git show 886600b5a2baa0c88f4d709dbc6ab0896e6565cb|| The result could look something like this: {{{#!diff commit 886600b5a2baa0c88f4d709dbc6ab0896e6565cb Author: Kaj Ailomaa Date: Mon Mar 18 22:15:05 2013 +0100 added a few lines to a README diff --git a/README b/README index e69de29..4a2b88c 100644 --- a/README +++ b/README @@ -0,0 +1 @@ +Adding a few lines to this README }}} <
> It contains most of the info we need for patching a Debian source package. It has the actual diff that will change the source code. It also includes the author of the commit, as well as a description of the commit. All this can be used when documenting the patch. If we were to create a patch from this, all we need to do is: {{{#!sh git show 886600b5a2baa0c88f4d709dbc6ab0896e6565cb > ../my-fix.patch }}} {i} ''When applying the patch, only the info following the diff data will be used during patching. The header will be ignored, so don't worry about that.'' /!\ ''If making multiple patches, make sure to keep track of which order they are to be applied, as one might overwrite another.'' = Applying a patch = Applying a patch is generally done by entering the root of the source directory. Then, using the command: {{{ patch -p 1 < /path/to/patch }}} See the man page for patch to learn more.