How to submit a patch
From The Chakra Project - Wiki
This page is mostly useful for translators, or people who want to submit a patch against our code. This is the right way to do this, since it's fast and easy (both for you and for us), and you will get credited in the changelog as well.
Contents |
Principle
This method relies on git for creating and eventually sending the patches. We are proposing 2 ways here: the first one is mostly indicated for people who want to submit a patch quickly and are not frequent contributors, whereas the second is most indicated for people who want to provide constant help and with a wider git knowledge. If you're unsure on what to do, or you're just providing a translation, you would be better off with the first one
Setting up git
Whichever method you will choose, you will need to set up git for your user if you still did not do it. It's quite easy and it boils down to these two commands:
git config --global user.name "Your name" git config --global user.email "Your email address"
Then you're good to go, and all your commits will be signed with your name and email
For translators
The po files are not the only ones who you should translate: in the sources you might find some .desktop or .notifyrc files that need translation as well. If you don't know how to do it, it's very simple. Open these files in a simple text editor, you will find some fields needing translation such as
Name=Configuration for updates
Supposing I'm italian and my locale is, hence, it, the translation would appear like this
Name=Configuration for updates Name[it]=Configurazione per gli aggiornamenti
That's all, please remember to include these files in your patch
Using git-format-patch to send patches through email
This method will let you create a patch (or a set of patches) ready to be applied. We will suppose we want to translate chase into the locale xyz (which obviously does not exist).
Starting off
First of all, you will have to clone the repository. All of our software (Shaman, Chase, Tribe, whatever) lies here: http://git.chakra-project.org . You can search the website and find the relevant project you want to contribute to. In this case we picked up chase, so let's start by cloning the repository. In a terminal you would write:
git clone git://git.chakra-project.org/tools/chase.git
This will download the repository in a directory named "chase" on your machine.
Getting the work done
We create the chase_xyz.po file and start modifying it. Once we're satisfied, we're ready to commit the result. Since we have created a new file, we need to add it to the repository:
git add chase_xyz.po
Good to go. Now we can commit the result.
git commit -am "Adding xyz translation for Chase"
You obviously should change the message to what suits you more. Now, let's suppose that right when you are about to send the patch you find out about a small mistake in the file. Don't panic, just do your modification, and commit again (no need for git add this time)
git commit -am "Updating xyz translation"
Don't worry about the 2 commits: git will handle that for you
Creating the patch
Ok, so our work is done and we just need to create the patches. It's really simple; just do
git format-patch origin
This command will create a set of patches out of all the commits you made since you cloned the repository. When running this command, you should be prompted a list of created files, one per commit. They should be named like <number>-commit-message.patch; so in our case git format-patch would create 0001-Adding-xyz-translation-for-Chase.patch and 0002-Updating-xyz-translation.patch. Remember to send ALL the patches, and not just the last ones!
These patches contains also your commit information, so your name will appear in the commit log.
Sending out the patches
You've made it this far! Now it comes the really easy part. You should submit your patches to manutortosa at chakra-project dot org for the translations and to drf at chakra-project dot org for the coding related patches, and you have 2 ways for doing this. One is the traditional one, just attach all your patches to an email and send it. Remember, in this case, to attach, and not to paste. git patches can be corrupted quite easily. The second method is git send-email, which would take care of formatting and sending the email for you. Unfortunately, it needs a bit of configuration, which you can do by using a small search on google. However, attaching the patches to an email is more than fine.
Doing it again
Whenever you want to contribute another patch in the same repository, just follow again these small steps. However, if you did not erase your "chase" directory containing the repository, there's no need to clone the repository again: just enter the directory and do a
git pull
Which will update your repository to the latest code available
And now?
You're done, just wait for your patch to be applied. Told you it was easy!
If you need some help or you have any question related to translations contact with Manuel at manutortosa at chakra-project dot org.
Cloning the repository on Gitorious and create a merge request
Coming soon