README.GIT-RULES 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ====================
  2. Git Commit Rules
  3. ====================
  4. This is the first file you should be reading when contributing code via Git.
  5. We'll assume you're basically familiar with Git, but feel free to post
  6. your questions on the mailing list. Please have a look at
  7. http://git-scm.com/ for more detailed information on Git.
  8. PHP is developed through the efforts of a large number of people.
  9. Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following
  10. some basic rules with regards to Git usage will::
  11. a. Make everybody happier, especially those responsible for maintaining
  12. PHP itself.
  13. b. Keep the changes consistently well documented and easily trackable.
  14. c. Prevent some of those 'Oops' moments.
  15. d. Increase the general level of good will on planet Earth.
  16. Having said that, here are the organizational rules::
  17. 1. Respect other people working on the project.
  18. 2. Discuss any significant changes on the list before committing and get
  19. confirmation from the release manager for the given branch.
  20. 3. Look at EXTENSIONS file to see who is the primary maintainer of
  21. the code you want to contribute to.
  22. 4. If you "strongly disagree" about something another person did, don't
  23. start fighting publicly - take it up in private email.
  24. 5. If you don't know how to do something, ask first!
  25. 6. Test your changes before committing them. We mean it. Really.
  26. To do so use "make test".
  27. 7. For development use the --enable-debug switch to avoid memory leaks
  28. and the --enable-maintainer-zts switch to ensure your code handles
  29. TSRM correctly and doesn't break for those who need that.
  30. Currently we have the following branches in use::
  31. master The active development branch.
  32. PHP-7.2 Is used to release the PHP 7.2.x series. This is a current
  33. stable version and is open for bugfixes only.
  34. PHP-7.1 Is used to release the PHP 7.1.x series. This is a current
  35. stable version and is open for bugfixes only.
  36. PHP-7.0 Is used to release the PHP 7.0.x series. This is an old
  37. stable version and is open for security fixes only.
  38. PHP-5.6 Is used to release the PHP 5.6.x series. This is an old
  39. stable version and is open for security fixes only.
  40. PHP-5.5 This branch is closed.
  41. PHP-5.4 This branch is closed.
  42. PHP-5.3 This branch is closed.
  43. PHP-5.2 This branch is closed.
  44. PHP-5.1 This branch is closed.
  45. PHP-4.4 This branch is closed.
  46. PHP-X.Y.Z These branches are used for the release managers for tagging
  47. the releases, hence they are closed to the general public.
  48. The next few rules are more of a technical nature::
  49. 1. All changes should first go to the lowest branch (i.e. 5.6) and then
  50. get merged up to all other branches. If a change is not needed for
  51. later branches (i.e. fixes for features which were dropped from later
  52. branches) an empty merge should be done.
  53. 2. All news updates intended for public viewing, such as new features,
  54. bug fixes, improvements, etc., should go into the NEWS file of *any
  55. stable release* version with the given change. In other words,
  56. news about a bug fix which went into PHP-5.4, PHP-5.5 and master
  57. should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but
  58. not master, which is not a public released version yet.
  59. 3. Do not commit multiple files and dump all messages in one commit. If you
  60. modified several unrelated files, commit each group separately and
  61. provide a nice commit message for each one. See example below.
  62. 4. Do write your commit message in such a way that it makes sense even
  63. without the corresponding diff. One should be able to look at it, and
  64. immediately know what was modified. Definitely include the function name
  65. in the message as shown below.
  66. 5. In your commit messages, keep each line shorter than 80 characters. And
  67. try to align your lines vertically, if they wrap. It looks bad otherwise.
  68. 6. If you modified a function that is callable from PHP, prepend PHP to
  69. the function name as shown below.
  70. The format of the commit messages is pretty simple.
  71. <max 79 characters short description>\n
  72. \n
  73. <long description, 79 chars per line>
  74. \n
  75. An Example from the git project (commit 2b34e486bc):
  76. pack-objects: Fix compilation with NO_PTHREDS
  77. It looks like commit 99fb6e04 (pack-objects: convert to use
  78. parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but
  79. hasn't noticed that the 'arg' variable no longer is available.
  80. If you fix some bugs, you should note the bug ID numbers in your
  81. commit message. Bug ID should be prefixed by "#" for easier access to
  82. bug report when developers are browsing CVS via LXR or Bonsai.
  83. Example:
  84. Fixed bug #14016 (pgsql notice handler double free crash bug.)
  85. When you change the NEWS file for a bug fix, then please keep the bugs
  86. sorted in decreasing order under the fixed version.
  87. You can use OpenGrok (http://lxr.php.net/) and gitweb (http://git.php.net/)
  88. to look at PHP Git repository in various ways.
  89. For further information on the process and further details please refer to
  90. https://wiki.php.net/vcs/gitworkflow and https://wiki.php.net/vcs/gitfaq
  91. Happy hacking,
  92. PHP Team