DTC-Xen Installation

DTC-Xen / Dom0 Howtos

DTC-Xen / DomU Howtos


DTC Howtos




Devel docs

Wiki - i18n

Wiki - Meta

Git /

How to create a patch file to send by email as contribution

0. Short explanations for lazy guys that don't want to read

Use git format-patch with the number you see in git-log as argument. Read further if you want to know in details.

1. Clone gplhost repository

   apt-get install git curl
   git clone

Wait for a while, the clone can take quite some time.

2. Modify the sources and commit

After the clone, cd in the dtc folder, and do any modification you want. When done, do:

   git commit -a

enter you comment in the editor that pops up, save and quit. For this example, we will say that you have entered: "Changed changelog" as the comment.

3. Rebase patches to send your patch on top

If you take a long time to build your patch, most probably there are already some new patches that has been sent to the origin. In this case, you want that your patch still appears "on top" of other patches, as if it was the latest modification. To do this, you should pull the latest changes to origin, and rebase your patches. Go in your Git local repository of DTC, and do:

   git pull
   git rebase

Then you can check that your patches appear on top:

   git log

4. Create and send the resulting patch files

You will need to call git format-patch with the latest git entry as parameter. To find this entry, go here:;a=summary

then put your mouse over the commit link, and see the h= parameter of the link. The URL should be like this:;a=commit;h=5688eb505af0a690d057c8b7a25bc762685b4d61

or, if the online repo has changed since your checkout, use your local repo to find the previous ID# before the commit you just did above:

   git log

and find the previous ID# before your current patch.

use this in the git format-patch command:

   git format-patch [ID-OF-PREVIOUS-COMMIT]

which in this case is:

   git format-patch 5688eb505af0a690d057c8b7a25bc762685b4d61

This will result output something like this:


Then simply send the 0001-Changed-changelog.txt (or more, if there's more files if you do more than one commit).

5. Where to send the result

Best is to subscribe to the dev mailing list. Send a mail to dtcdev-subscribe at to register. If your patch is bigger than 16k, then best is to send the files in any web server that you have access to, and send a link to it in the list with your comments in the body of the message saying what the patch does.

Note that there's a web archive of the dev list here and that it wont publish your email domain.

6. How the git master person will include your patch

Simply by doing:

   git-am 0001-Changed-changelog.txt

and this way it will include your name and comments to the git and gitweb correctly. In some versions of git you should run git am intead of git-am

I hope this short text will help to have more contributions.

Page last modified on May 11, 2013, at 12:53 AM EST