Skip to content

[Contributing] Added workflow details on bugfix patches for latest active branch #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 22, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions contributing/code/patches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,26 @@ Create the topic branch with the following command:

$ git checkout -b BRANCH_NAME master

.. tip::
Or, if you want to provide a bugfix for the 2.0 branch, you need to first track
the remote `2.0` branch locally:

.. code-block:: bash

$ git checkout -t origin/2.0

Then you can create a new branch off the 2.0 branch to work on the bugfix:

.. code-block:: bash

Replace "master" by, for example, 2.0, if you wish to submit a patch to the
2.0 branch.
$ git checkout -b BRANCH_NAME 2.0

.. tip::

Use a descriptive name for your branch (`ticket_XXX` where `XXX` is the
ticket number is a good convention for bug fixes).

The above command automatically switches the code to the newly created branch
(check the branch you are working on with `git branch`).
The above checkout commands automatically switch the code to the newly created
branch (check the branch you are working on with `git branch`).

Work on the code as much as you want and commit as much as you want; but keep
in mind the following:
Expand Down Expand Up @@ -205,6 +213,10 @@ while to finish your changes):
$ git checkout BRANCH_NAME
$ git rebase master

.. tip::

Replace `master` with `2.0` if you are working on a bugfix

When doing the ``rebase`` command, you might have to fix merge conflicts.
``git status`` will show you the *unmerged* files. Resolve all the conflicts,
then continue the rebase:
Expand All @@ -230,13 +242,19 @@ message, like in:
[Yaml] foo bar
[Form] [Validator] [FrameworkBundle] foo bar

.. tip::

Take care to point your pull request towards ``symfony:2.0`` if you want
the core team to pull a bugfix based on the 2.0 branch.

If you are going to send an email to the mailing-list, don't forget to
reference you branch URL (``https://github.com/USERNAME/symfony.git
BRANCH_NAME``) or the pull request URL.

Based on the feedback from the mailing-list or via the pull request on GitHub,
you might need to rework your patch. Before re-submitting the patch, rebase
with master, don't merge; and force the push to the origin:
with upstream/master or upstream/2.0, don't merge; and force the push to the
origin:

.. code-block:: bash

Expand Down