author sheepluva
Tue, 19 Jan 2016 18:59:12 +0000
changeset 768 6d2816127552
parent 728 1b0f7b17e748
child 769 ccf2964c7497
permissions -rw-r--r--
ContributingCode: Edited via web interface

#summary Useful hints for contributing code to Hedgewars

*Table of Contents*
<wiki:toc max_depth="2" />

= Introduction =

You want to contribute code to Hedgewars? That's great! Here are some hints how to help us with importing your code.

= Recommended workflows =

== Using a mercurial clone ==


=== Using (named) branches ===
Branches are alternative commit histories.

The commits history from one branch, up to any commit, can be merged into other branches when needed.
Note: In Mercurial merging a commit always means to also merge all its ancestor commits.

_Most main development happens on the main repository branch "default"._

We prefer *not* to use separate branches for little patches, as branches are permanent and will clutter the list of {{{hg branches}}}.

*So for small code contributions, use "unnamed branches" instead (see below).*

_However, if you are going to write code that is more a project than a patch and that will take dozens of commits, feel free to do that work on a new branch._

To create a new branch use {{{hg branch}}} followed by the name of the new branch, before committing the first code.

=== Using unnamed branches ===

_Unnamed branches_ a.k.a. _topological branches_ happen when the history of commits within a branch (e.g. "default") splits up into  alternative commits chains.
These alternative chains will have more than one {{{head}}} (at the the end of each chain) within the same branch, until they will be merged back together into a single chain.

*In order for us to be able which bugfixes/features of you we merge into the official repository, you should put each in a separate _unnamed branch_ as described above.*

Make sure that the first commit of each bugfix/feature commit set is based on a commit from the official repository, that way your bugfixes/features will not depend on the commits of each other and can be merged into official individually, as needed.

That means: *Before you start writing code towards a new bugfix/feature, make sure to {{{hg update}}} to a revision from the official repository.*

In newer versions of Mercurial you can give those unnamed branches a "local" and removable name using {{{hg bookmark}}}.

*You can see example of how unnamed branches and bookmarks are used best [ HERE]*

= How to export your changes so that we can use them  =

TODO: diffs, exported patches, public repo clone, etc.

== Public Repository ==
If you setup a public repository e.g. at github, bitbucket or your own server, just push your commits there.
Then send us the links to the commits/bookmarks in question!

= How to let us know that you want your commits/patches to go into the official repository =

Just send your patches (or links to them) to [/contact.html the development mailing list].

Don't forget to add a short description (can be a copy of the commit message if it's explaining everything needed).

*Note*: Please be aware that by sending in patches you grant unC0Rr (the project leader) *all rights* to your code (and any patents you may hold on it).
That implies that your code *will be made public* under the *[ GNU GPL2]*.