To contribute a change or addition to existing source code:
If all this works, you can create your patch. Remove all build products and remnants (like any 'build', 'dist' or 'bin' directories) from the module tree, then build the actual patch. Here's how to do it using the command line SVN client under unix:
Apache projects prefer the unified diff format. The subversion tool creates that automatically. If you use other tools, please refer to their documentation for details on setting the diff format.
# location where the modules are stored cd checkout</p> <div class="codehilite"><pre><span class="c"># directory of the module</span> <span class="n">cd</span> <span class="n">site</span> <span class="c"># creation of the diff</span> <span class="n">svn</span> <span class="nb">diff</span> <span class="o">></span> <span class="n">site</span><span class="p">.</span><span class="nb">patch</span> </pre></div>
The Subversion client now examines all subdirectories for changed files, then compares the changed file to the one on the server. It generates the patch.
The '>' redirection results in the resulting patch being put in a text file named (in this case)
With your patch generated, you need to send it to the developers. Different projects have different preferences for this. Usually you add it as an attachment to the relevant bug report in the bug tracking database. If a relevant bug report doesn't exist yet, create one.
See Getting started with Git for general information.
The general pattern for creating and submitting a patch for a project using Git is:
One or more of the project's committers will review your proposed changes and, if all is well, merge them.
A very few projects don't use an issue tracker. In that case, send the patch as an attachment to an e-mail with a subject prefixed with "
[PATCH]", to the appropriate development mailing list. If the patch is large, please ask before e-mailing it in case there is a better way to provide it.
Supply a different patch per issue. A patch can span multiple files but you should normally try not to fix multiple bugs in a single patch, unless those bugs are intimately related.
Be patient if your patch is not applied as fast as you'd like (open source developers are all volunteers, often doing the development in their spare time) or a developer asks you to make changes to the patch. If you do not receive any feedback in a reasonable amount of time (say, a week or two), feel free to send a follow-up e-mail to the developer list.