From: Dmitry Volyntsev Date: Fri, 29 May 2026 22:34:01 +0000 (-0700) Subject: Centralize commit message guidance X-Git-Tag: 1.0.0~38 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/NGINX-js-1660x332.png%20%22NGINX%20JavaScript%20Banner%22?a=commitdiff_plain;h=32cba98d304707fc9aa41b2de92b8d808fb970c2;p=njs.git Centralize commit message guidance Make CONTRIBUTING.md the canonical source for commit message style and point agent development notes to that guide instead of duplicating the rules. --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4ef7937..9d85a99e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,16 +80,20 @@ about coding conventions and style. - Keep a clean, concise and meaningful git commit history on your branch, rebasing locally and squashing before submitting a PR -- In the subject line, use the past tense ("Added feature", not "Add feature"); - also, use past tense to describe past scenarios, and present tense for - current behavior +- Each commit message should have a single-line subject line followed by a + verbose description after an empty line. -- Limit the subject line to 67 characters, and the rest of the commit message - to 80 characters +- Limit the subject and commit message body lines to 72 characters. -- Use subject line prefixes for commits that affect a specific portion of the - code; examples include "Tests:", "HTTP:", or "Core:". See the commit history - to get an idea of the prefixes used. +- Use a subject line prefix only when local history clearly uses one for the + changed area; examples include "HTTP:", "Stream:", "QuickJS:", "Tests:", or + "Modules:". Otherwise use no prefix; do not invent generic prefixes. -- Reference issues and PRs liberally after the subject line; if the commit - remedies a GitHub issue, [name it](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) accordingly +- Read recent commit history and write commit logs in the established njs + style. + +- If the commit fixes an open issue, use the phrase + "This closes #nn issue on GitHub." + + That should go at the end of the commit message, separated by a blank line, + along with any other tags. diff --git a/docs/agent/engine-dev.md b/docs/agent/engine-dev.md index f7a764c0..89f0b78a 100644 --- a/docs/agent/engine-dev.md +++ b/docs/agent/engine-dev.md @@ -147,13 +147,7 @@ NGINX coding style: Commit messages: -- Past tense subject (`Added X`, `Fixed Y`). -- Subject ≤72 chars, body wrapped to ~80 chars. -- Use a subject prefix only when local history clearly uses one for the - changed area, such as `HTTP:`, `Stream:`, `QuickJS:`, `Tests:`, or - `Modules:`. Otherwise use no prefix; do not invent generic prefixes. -- Read recent commit history and write commit logs in the established njs - style. +- Follow the [Git style guide](../../CONTRIBUTING.md#git-style-guide). - One logical change per commit; rebase/squash before submitting. ## Project layout