diff --git a/contributing/code/git.rst b/contributing/code/git.rst new file mode 100644 index 00000000000..affaefb2a8b --- /dev/null +++ b/contributing/code/git.rst @@ -0,0 +1,42 @@ +Git +=== + +This document explains some conventions and specificities in the way we manage +the Symfony code with Git. + +Pull Requests +------------- + +Whenever a pull request is merged, all the information contained in the pull +request (including comments) are saved in the repository. + +You can easily spot pull request merges as the commit message always follows +this pattern: + +.. block: text + + merged branch USER_NAME/BRANCH_NAME (PR #1111) + +The PR reference allows you to have a look at the original pull request on +Github: https://github.com/symfony/symfony/pull/1111. But all the information +you can get on Github are also available from the repository itself. + +The merge commit message contains the original message from the author of the +changes. Often, this can help understand what the changes were about and the +reasoning behind the changes. + +Moreover, the full discussion that might have occurred back then is also +stored as a Git note (before March 22 2013, the discussion was part of the +main merge commit message). To get access to these notes, add this line to +your ``.git/config`` file: + +.. block: text + + fetch = +refs/notes/*:refs/notes/* + +After a fetch, getting the Github discussion for a commit is then a matter of +adding ``--show-notes=github-comments`` to the ``git show`` command: + +.. block: text + + git show HEAD --show-notes=github-comments diff --git a/contributing/code/index.rst b/contributing/code/index.rst index 0a936b2a0df..a675e00f2ce 100644 --- a/contributing/code/index.rst +++ b/contributing/code/index.rst @@ -10,4 +10,5 @@ Contributing Code tests standards conventions + git license