Submitting patches for Gpredict
This page provides some basic guidelines for submitting patches to the Gpredict code.
- Gpredict uses git for source code management and patches should always be submitted against the latest code in the master branch.
- Clean your code for whitespace errors (hint:
git diff --check)
- Commit logically separate changesets, i.e. one commit per topic. Don't combine several topics into one patch and don't split one topic over many commits.
- Use meaningful commit messages. As a general rule, your messages should start with a single line that’s no more than about 50 characters and that describes the changeset concisely, followed by a blank line, followed by a more detailed explanation.
- If the changes fix a known bug or implement a requested feature, the ID of the bug/feature should appear in the first line.
- Work in a separate branch and create the patches using
git format-patch -M origin/master. If not possible
git diff origin/masterwill also be acceptable for small changes.
- Submit the patches to one of the following:
Note that submitting a patch is no guarantee that it will be applied.
This section shows an example workflow for creating a patch according the the requirements listed above.
First, get the latest code from the git repository:
$ git clone git://gpredict.git.sourceforge.net/gitroot/gpredict/gpredict gpredict.git $ cd gpredict.git
If you already have a copy pull the latest changes:
$ git pull
Ensure that your name and email address is properly configured. If it is configured globally you're fine, if not you can configure it locally for gpredict:
$ git config --global user.name "Firstname Lastname" $ git config --global user.email "email@example.com"
Next, create a branch where you will be doing your work:
$ git checkout -b mywork
When finished, check your code for whitespace errors:
$ git diff --check
and commit your changes:
$ git add file1 file2 file3 $ git commit
Format the commit message according to the requirements. In case of small changes a 50 char or less one liner may be sufficient. In such cases you can use
git commit -m 'My commit message'.
Before you create the patch, it is important to update your local copy to the latest code and rebase your changes accordingly:
$ git checkout master $ git pull $ git checkout mywork $ git rebase master
This will replay your changes on top of the latest changes from master. See
git help rebase for more information. If a conflict occurs during the rebase, it must be resolved before you can proceed.
When ready, create the patch(es):
$ git format-patch -M master
This will create some nicely formatted patches, one patch per commit. Author information will be included in each patch.
Submit the patches at the appropriate place, see the last bullet of the requirements.