Skip to content

Commit 6935fd1

Browse files
committed
Merge pull request #1007 from ManuelKiessling/contributing_bugfixes
[Contributing] Added workflow details on bugfix patches for latest active branch
2 parents 8a656ee + 117ade0 commit 6935fd1

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

contributing/code/patches.rst

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,26 @@ Create the topic branch with the following command:
155155
156156
$ git checkout -b BRANCH_NAME master
157157
158-
.. tip::
158+
Or, if you want to provide a bugfix for the 2.0 branch, you need to first track
159+
the remote `2.0` branch locally:
160+
161+
.. code-block:: bash
162+
163+
$ git checkout -t origin/2.0
164+
165+
Then you can create a new branch off the 2.0 branch to work on the bugfix:
166+
167+
.. code-block:: bash
159168
160-
Replace "master" by, for example, 2.0, if you wish to submit a patch to the
161-
2.0 branch.
169+
$ git checkout -b BRANCH_NAME 2.0
162170
163171
.. tip::
164172

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

168-
The above command automatically switches the code to the newly created branch
169-
(check the branch you are working on with `git branch`).
176+
The above checkout commands automatically switch the code to the newly created
177+
branch (check the branch you are working on with `git branch`).
170178

171179
Work on the code as much as you want and commit as much as you want; but keep
172180
in mind the following:
@@ -205,6 +213,10 @@ while to finish your changes):
205213
$ git checkout BRANCH_NAME
206214
$ git rebase master
207215
216+
.. tip::
217+
218+
Replace `master` with `2.0` if you are working on a bugfix
219+
208220
When doing the ``rebase`` command, you might have to fix merge conflicts.
209221
``git status`` will show you the *unmerged* files. Resolve all the conflicts,
210222
then continue the rebase:
@@ -230,13 +242,19 @@ message, like in:
230242
[Yaml] foo bar
231243
[Form] [Validator] [FrameworkBundle] foo bar
232244
245+
.. tip::
246+
247+
Take care to point your pull request towards ``symfony:2.0`` if you want
248+
the core team to pull a bugfix based on the 2.0 branch.
249+
233250
If you are going to send an email to the mailing-list, don't forget to
234251
reference you branch URL (``https://github.com/USERNAME/symfony.git
235252
BRANCH_NAME``) or the pull request URL.
236253

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

241259
.. code-block:: bash
242260

0 commit comments

Comments
 (0)