Skip to content

Commit a8e879c

Browse files
committed
Join README.GIT-RULES and CONTRIBUTING.md
This patch joins two very much related pieces of docs together in a single file dedicated to all sorts of contributing info. Some more changes: - Branches info copied from the current master branch - LXR and bonsai info removed - Duplicated info reduced a bit - Security branch updated to 7.1 - Refactor intro for Git commit rules - Updated README.GIT-RULES file usage in win32/build/confutils.js - Refactored configure.ac
1 parent acf0411 commit a8e879c

File tree

6 files changed

+121
-151
lines changed

6 files changed

+121
-151
lines changed

CONTRIBUTING.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ had several contributions accepted, commit privileges are often quickly granted.
2323
* [Checklist for submitting contribution](#checklist-for-submitting-contribution)
2424
* [What happens after submitting contribution?](#what-happens-after-submitting-contribution)
2525
* [What happens when your contribution is applied?](#what-happens-when-your-contribution-is-applied)
26+
* [Git commit rules](#git-commit-rules)
2627

2728
## Pull requests
2829

@@ -277,4 +278,120 @@ Your name will likely be included in the Git commit log. If your change affects
277278
end users, a brief description and your name might be added to the [NEWS](/NEWS)
278279
file.
279280

281+
## Git commit rules
282+
283+
This section refers to contributors that have Git push access and make commit
284+
changes themselves. We'll assume you're basically familiar with Git, but feel
285+
free to post your questions on the mailing list. Please have a look at the more
286+
detailed [information on Git](https://git-scm.com/).
287+
288+
PHP is developed through the efforts of a large number of people. Collaboration
289+
is a Good Thing(tm), and Git lets us do this. Thus, following some basic rules
290+
with regards to Git usage will:
291+
292+
* Make everybody happier, especially those responsible for maintaining PHP
293+
itself.
294+
* Keep the changes consistently well documented and easily trackable.
295+
* Prevent some of those 'Oops' moments.
296+
* Increase the general level of good will on planet Earth.
297+
298+
Having said that, here are the organizational rules:
299+
300+
1. Respect other people working on the project.
301+
302+
2. Discuss any significant changes on the list before committing and get
303+
confirmation from the release manager for the given branch.
304+
305+
3. Look at [EXTENSIONS](/EXTENSIONS) file to see who is the primary maintainer
306+
of the code you want to contribute to.
307+
308+
4. If you "strongly disagree" about something another person did, don't start
309+
fighting publicly - take it up in private email.
310+
311+
5. If you don't know how to do something, ask first!
312+
313+
6. Test your changes before committing them. We mean it. Really. To do so use
314+
`make test`.
315+
316+
7. For development use the `--enable-debug` switch to avoid memory leaks and the
317+
`--enable-maintainer-zts` switch to ensure your code handles TSRM correctly
318+
and doesn't break for those who need that.
319+
320+
Currently we have the following branches in use:
321+
322+
| Branch | |
323+
| --------- | --------- |
324+
| master | Active development branch for PHP 8.0, which is open for backwards incompatible changes and major internal API changes. |
325+
| PHP-7.4 | Active development branch for PHP 7.4, which is open for new features and minor internal API changes. |
326+
| PHP-7.3 | Is used to release the PHP 7.3.x series. This is a current stable version and is open for bugfixes only. |
327+
| PHP-7.2 | Is used to release the PHP 7.2.x series. This is a current stable version and is open for bugfixes only. |
328+
| PHP-7.1 | Is used to release the PHP 7.1.x series. This is an old stable version and is open for security fixes only. |
329+
| PHP-7.0 | This branch is closed. |
330+
| PHP-5.6 | This branch is closed. |
331+
| PHP-5.5 | This branch is closed. |
332+
| PHP-5.4 | This branch is closed. |
333+
| PHP-5.3 | This branch is closed. |
334+
| PHP-5.2 | This branch is closed. |
335+
| PHP-5.1 | This branch is closed. |
336+
| PHP-4.4 | This branch is closed. |
337+
| PHP-X.Y.Z | These branches are used for the release managers for tagging the releases, hence they are closed to the general public. |
338+
339+
The next few rules are more of a technical nature:
340+
341+
1. All non-security bugfix changes should first go to the lowest bugfix branch
342+
(i.e. 7.2) and then get merged up to all other branches. All security fixes
343+
should go to the lowest security fixes branch (i.e 7.1). If a change is not
344+
needed for later branches (i.e. fixes for features which were dropped from
345+
later branches) an empty merge should be done.
346+
347+
2. All news updates intended for public viewing, such as new features, bug
348+
fixes, improvements, etc., should go into the NEWS file of *any stable
349+
release* version with the given change. In other words, news about a bug fix
350+
which went into PHP-5.4, PHP-5.5 and master should be noted in both
351+
PHP-5.4/NEWS and PHP-5.5/NEWS but not master, which is not a public released
352+
version yet.
353+
354+
3. Do not commit multiple files and dump all messages in one commit. If you
355+
modified several unrelated files, commit each group separately and provide a
356+
nice commit message for each one. See example below.
357+
358+
4. Do write your commit message in such a way that it makes sense even without
359+
the corresponding diff. One should be able to look at it, and immediately
360+
know what was modified. Definitely include the function name in the message
361+
as shown below.
362+
363+
5. In your commit messages, keep each line shorter than 80 characters. And try
364+
to align your lines vertically, if they wrap. It looks bad otherwise.
365+
366+
6. If you modified a function that is callable from PHP, prepend PHP to the
367+
function name as shown below.
368+
369+
The format of the commit messages is pretty simple.
370+
371+
<max 79 characters short description>\n
372+
\n
373+
<long description, 79 chars per line>
374+
\n
375+
376+
An Example from the git project (commit 2b34e486bc):
377+
378+
pack-objects: Fix compilation with NO_PTHREDS
379+
380+
It looks like commit 99fb6e04 (pack-objects: convert to use parse_options(),
381+
2012-02-01) moved the #ifdef NO_PTHREDS around but hasn't noticed that the
382+
'arg' variable no longer is available.
383+
384+
If you fix some bugs, you should note the bug ID numbers in your commit message.
385+
Bug ID should be prefixed by `#`.
386+
387+
Example:
388+
389+
Fixed bug #14016 (pgsql notice handler double free crash bug.)
390+
391+
When you change the NEWS file for a bug fix, then please keep the bugs sorted in
392+
decreasing order under the fixed version.
393+
394+
You can use [gitweb](https://git.php.net/) to look at PHP Git repository in
395+
various ways.
396+
280397
Thank you for contributing to PHP!

README.GIT-RULES

Lines changed: 0 additions & 146 deletions
This file was deleted.

README.RELEASE_PROCESS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ Forking a new release branch
338338
Add a commit on master after the branch point clearing the NEWS, UPGRADING
339339
and UPGRADING.INTERNALS files, updating the version in configure.ac (run
340340
./configure to automatically update main/php_versions.h, too) and Zend/zend.h.
341-
Also list the new branch in README.GIT-RULES.
341+
Also list the new branch in CONTRIBUTING.md.
342342
Example: http://git.php.net/?p=php-src.git;a=commit;h=a63c99b
343343
Push the new branch and the commit just added to master.
344344

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ contribute:
9494

9595
- [Contributing to PHP](/CONTRIBUTING.md)
9696
- [PHP coding standards](/CODING_STANDARDS)
97-
- [Git rules](/README.GIT-RULES)
9897
- [Mailinglist rules](/README.MAILINGLIST_RULES)
9998
- [PHP release process](/README.RELEASE_PROCESS)
10099

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dnl Basic autoconf initialization, generation of config.nice.
88
dnl -------------------------------------------------------------------------
99

1010
AC_PREREQ([2.68])
11-
AC_INIT(README.GIT-RULES)
11+
AC_INIT([main/php_version.h])
1212
AC_CONFIG_AUX_DIR([build])
1313
AC_PRESERVE_HELP_ORDER
1414

win32/build/confutils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ if (MODE_PHPIZE) {
106106
WScript.Quit(10);
107107
}
108108
} else {
109-
if (!FSO.FileExists("README.GIT-RULES")) {
109+
if (!FSO.FileExists("main\\php_version.h")) {
110110
STDERR.WriteLine("Must be run from the root of the php source");
111111
WScript.Quit(10);
112112
}
@@ -115,7 +115,7 @@ if (MODE_PHPIZE) {
115115
var CWD = WshShell.CurrentDirectory;
116116

117117
if (typeof(CWD) == "undefined") {
118-
CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.GIT-RULES"));
118+
CWD = FSO.GetParentFolderName(FSO.GetParentFolderName(FSO.GetAbsolutePathName("main\\php_version.h")));
119119
}
120120

121121
/* defaults; we pick up the precise versions from configure.ac */

0 commit comments

Comments
 (0)