Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit dfe5ed3

Browse files
committed
[Contributing] New PR and commit reqs.
Introducing new pull request and commit requirements.
1 parent 627ec9a commit dfe5ed3

File tree

4 files changed

+113
-2
lines changed

4 files changed

+113
-2
lines changed

contributing/code.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ Contributing
44
The Symfony2 CMF team follows all the rules and guidelines of the core
55
Symfony2 `development process`_.
66

7-
When creating Pull Requests, please follow the Symfony `Submitting a Patch`_ guidlines.
7+
When creating Pull Requests, please follow the Symfony `Submitting a Patch`_ guidlines
8+
with the added requirement of our :doc:`pr_style_and_commits`.
9+
810

911
Resources / Links
1012
-----------------
@@ -25,4 +27,4 @@ Resources / Links
2527
.. _`IRC channel`: irc://freenode/#symfony-cmf
2628
.. _`Users mailing list`: http://groups.google.com/group/symfony-cmf-users
2729
.. _`Devs mailing list`: http://groups.google.com/group/symfony-cmf-devs
28-
.. _`Submitting a Patch`: http://symfony.com/doc/current/contributing/code/patches.html
30+
.. _`Submitting a Patch`: http://symfony.com/doc/current/contributing/code/patches.html

contributing/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Contributing
55
:hidden:
66

77
code
8+
pr_style_and_commits
89
bundles
910
releases
1011
license

contributing/map.rst.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
* :doc:`code`
2+
* :doc:`pr_style_and_commits`
23
* :doc:`bundles`
34
* :doc:`releases`
45
* :doc:`license`

contributing/pr_style_and_commits.rst

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
Pull request and commit requirements
2+
====================================
3+
4+
Pull requests
5+
-------------
6+
7+
The pull request body should adhere to the Symfony standard `as defined here`_
8+
9+
Commits
10+
-------
11+
12+
Before a pull request is merged the commit should be squashed (i.e. there
13+
should be a single commit in the pull request with all of your work in it).
14+
15+
Squashing
16+
~~~~~~~~~
17+
18+
You can easily squash a commit using `git rebase` as follows:
19+
20+
.. code-block:: bash
21+
22+
$ git rebase --interactive HEAD~<number of commits in your pull request>
23+
24+
For example, if your pull request on github has 4 commits:
25+
26+
.. code-block:: bash
27+
28+
$ git rebase --interactive HEAD~4
29+
30+
You will then be presented with a screen in your editor which looks something
31+
like this:
32+
33+
.. code-block:: bash
34+
35+
pick 608cc0f fix link to CoreBundle Documentation
36+
pick be141b0 Correctly use Testing features
37+
pick 6e2ebf5 Changed PHPunit config
38+
pick c396b08 Changed travis config
39+
40+
Tell github to pick the first one and squash the rest as follows:
41+
42+
.. code-block:: bash
43+
44+
pick 608cc0f fix link to CoreBundle Documentation
45+
s be141b0 Correctly use Testing features
46+
s 6e2ebf5 Changed PHPunit config
47+
s c396b08 Changed travis config
48+
49+
Save the file and quit. GIT should now squash all your commits and ask you
50+
for a new commit message.
51+
52+
Commit Message
53+
~~~~~~~~~~~~~~
54+
55+
The commit message should be formatted as follows:
56+
57+
.. code-block::
58+
59+
[<subject] <Short description>
60+
==============================
61+
62+
Fixes: <list of issues fixed>
63+
64+
<long description>
65+
66+
BC Breaks (as required)
67+
---------
68+
69+
<list of BC breaks and required migrations>
70+
71+
Deprecations (as required)
72+
------------
73+
74+
<list of deprecations>
75+
76+
For example:
77+
78+
.. code-block::
79+
80+
[Initializer] Initializers use ManagerRegistry
81+
==============================================
82+
83+
Fixes: #1234, #4321
84+
85+
Initializers are now passed an instance of `ManagerRegistry` instead
86+
of the `Phpcr\Session`. This means that initializers can retrieve both
87+
the PHPCR session and the `DocumentManager`.
88+
89+
This PR also introduces a requirement that all initializers provide a name
90+
which can be used in diagnostics.
91+
92+
BC Breaks
93+
---------
94+
95+
- The `init` method of the InitializerInterface now accepts a
96+
`ManagerResistry` instead of a `PhpcrSession`. The PHPCR session can
97+
be retrieved using `$registry->getConnection` and the manager with
98+
`$registry->getManager()`;
99+
100+
- The first argument to the `GenericInitializer` constructor is now the
101+
name of the initializer.
102+
103+
Deprecations
104+
------------
105+
106+
This is just an example, there are no deprecations, but if there were
107+
deprecations they sure would be listed here.

0 commit comments

Comments
 (0)