From 0d9368922b3db717569e057ca77ebd6dac0f09d2 Mon Sep 17 00:00:00 2001 From: Bart van den Burg Date: Thu, 15 Dec 2011 15:09:40 +0100 Subject: [PATCH 1/5] added a note about line endings in windows, fixes #913 --- contributing/code/patches.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index d8ec09d7dfc..ce908745eb2 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -93,6 +93,28 @@ Set up your user information with your real name and a working email address: If you are new to Git, we highly recommend you to read the excellent and free `ProGit`_ book. +.. tip:: + + Windows users: when installing Git, the installer will ask what to do with + line endings and suggests to replace all Lf by CrLf. This is the wrong + setting if you wish to contribute to Symfony! Either select the as-is method + or the Lf method. If you have already installed Git, you can check the value + of this setting by typing: + + .. code-block:: bash + + $ git config core.autocrlf + + This will return either "false", "input" or "true", "true" being the wrong + value. Set it to another value by typing: + + .. code-block:: bash + + $ git config --global core.autocrlf false + + Replace --global by --local if you want to set it only for the active + repository + Get the Symfony2 source code: * Create a `GitHub`_ account and sign in; From 5d92960c42a45300c80baaac1d0ad4c47dbbaaad Mon Sep 17 00:00:00 2001 From: Bart van den Burg Date: Thu, 15 Dec 2011 15:11:00 +0100 Subject: [PATCH 2/5] added a note about committing patches to the 2.0 branch --- contributing/code/patches.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index ce908745eb2..d34ff339472 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -154,6 +154,11 @@ Create the topic branch with the following command: $ git checkout -b BRANCH_NAME master +.. tip:: + + Replace "master" by, for example, 2.0, if you wish to submit a patch to the + 2.0 branch. + .. tip:: Use a descriptive name for your branch (`ticket_XXX` where `XXX` is the From 30e58693f9b593b3c68e64e88d730f79e197b111 Mon Sep 17 00:00:00 2001 From: Bart van den Burg Date: Thu, 15 Dec 2011 15:18:17 +0100 Subject: [PATCH 3/5] added information on squashing commits --- contributing/code/patches.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index d34ff339472..d2b6ddceb16 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -242,6 +242,29 @@ with master, don't merge; and force the push to the origin: $ git rebase -f upstream/master $ git push -f origin BRANCH_NAME +Often, moderators will ask you to "squash" your commits. This means you will +convert many commits to one commit. To do this, use the rebase command: + +.. code-block:: bash + + $ git rebase -i head~3 + $ git push -f origin BRANCH_NAME + +The number 3 here must equal the amount of commits in your branch. After you +type this command, an editor will popup showing a list of commits: + +.. code-block:: text + + pick 1a31be6 first commit + pick 7fc64b4 second commit + pick 7d33018 third commit + +To squash all commits into the first one, remove the word "pick" before the +second and the last commits, and replace it by the word "squash" or just "s". +When you save, git will start rebasing, and if succesful, will ask you to edit +the commit message, which by default is a listing of the commit messages of all +the commits. When you finish, execute the push command. + .. note:: All patches you are going to submit must be released under the MIT From 77ffd39769bde007666e2e458c07c55eb2de53d9 Mon Sep 17 00:00:00 2001 From: Bart van den Burg Date: Thu, 15 Dec 2011 15:50:45 +0100 Subject: [PATCH 4/5] updates per @stof --- contributing/code/patches.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index d2b6ddceb16..a2fd798f206 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -96,21 +96,22 @@ Set up your user information with your real name and a working email address: .. tip:: Windows users: when installing Git, the installer will ask what to do with - line endings and suggests to replace all Lf by CrLf. This is the wrong - setting if you wish to contribute to Symfony! Either select the as-is method - or the Lf method. If you have already installed Git, you can check the value - of this setting by typing: + line endings and suggests to replace all Lf by CRLF. This is the wrong + setting if you wish to contribute to Symfony! Selecting the as-is method is + your best choice, as git will convert your line feeds to the ones in the + repository. If you have already installed Git, you can check the value of + this setting by typing: .. code-block:: bash $ git config core.autocrlf - This will return either "false", "input" or "true", "true" being the wrong - value. Set it to another value by typing: + This will return either "false", "input" or "true", "true" and "false" being + the wrong values. Set it to another value by typing: .. code-block:: bash - $ git config --global core.autocrlf false + $ git config --global core.autocrlf input Replace --global by --local if you want to set it only for the active repository From 7e586aac89e6137f76edd167f275ef423ef47bc9 Mon Sep 17 00:00:00 2001 From: Bart van den Burg Date: Thu, 15 Dec 2011 15:53:47 +0100 Subject: [PATCH 5/5] added a note per @stof --- contributing/code/patches.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index a2fd798f206..c8803ad874e 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -243,6 +243,12 @@ with master, don't merge; and force the push to the origin: $ git rebase -f upstream/master $ git push -f origin BRANCH_NAME +.. note:: + + when doing a push -f (or --force), always specify the branch name explicitly + to avoid messing other branches in the repo (--force tells git that you + really want to mess with things so do it carefully). + Often, moderators will ask you to "squash" your commits. This means you will convert many commits to one commit. To do this, use the rebase command: