Git Workflow

Git does not enforce a certain workflow. For php-src we will use a workflow that is described bellow.

We will use release branches for the php-src.git repository. We will have branches for actively maintained
versions. For example: 5.6, 7.0 and master . A patch will be applied to the oldest possible branch.
If the Release Manager of 5.6 accepts the change, commit it to the 5.6 branch. We will use regular merging between the release branches.
Bigger features can use feature branches, but developers are encouraged to fork php on github and start implementing the
feature there on the respective branch.

Bugfix Workflow for Core Developers

Core developers that have access to the php-src.git repository apply changes to the lower possible branch and then
merge the change upwards. The repository is prepared in a way, that only new changes will be merged upwards. E.g. Git will not attempt
to synchronize the whole 5.6 and 7.0 branch. Only your commit will be merged.

TL;DR: Always try to merge PHP-5.6 into PHP-7.0 and then PHP-7.0 into master. If you are unsure ask dsp

Merge patches received per mail

If patches are created with “git format-patch”, you can easily apply them with git's am command:

$ git am 000*

Normal diff-patches can be applied with git apply:

$ git apply <patchfile>

Feature Workflow for Core Developers

Feature development can take a lot of time. You might not know to which branch the feature will be commited or you want to combine commits before pushing the final bits. Therefore it is adviced to use a separate branch while you develop your feature. This approach is called a feature branch:

The workflows aims for a feature to be included into the master branch. So we branch of the master branch first:

If you don't have an issue-number, just make the branch name self-descriptive (ie: “json_encoding_fix” instead of “branch-001”).
As stated before, branch from the lowest version possible. When you want to create a patch that needs to be incorporated into several branches, like a security fix for something in PHP-5.3, PHP-5.4, PHP-5.5 and the master, make sure you checkout a branch from PHP-5.3. You don't need to create separate pull requests for PHP-5.4, PHP-5.5 and master.

New Commit Message Format

pack-objects: Fix compilation with NO_PTHREDS
It looks like commit 99fb6e04 (pack-objects: convert to use
parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but
hasn't noticed that the 'arg' variable no longer is available.

Git commands like log, shortlog, etc support this format and make use of the short description. Please stick to the format.