Skip to content

Commit eae21c5

Browse files
committed
doc: add commit message guidelines to the dev guide
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
1 parent 3da1473 commit eae21c5

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

doc/developer/workflow.rst

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,64 @@ This helps to automatically generate human-readable changelog messages.
354354
Commit Guidelines
355355
-----------------
356356

357-
There is a built-in commit linter. Basic rules:
357+
Commit messages must have a title and optionally a detailed description.
358358

359-
- Commit messages must be prefixed with the name of the changed subsystem, followed
360-
by a colon and a space and start with an imperative verb.
359+
The commit title is a short summary of the commit. The following rules apply:
361360

361+
- Must be no more than 72 characters
362+
- Must be prefixed with the name of the changed subsystem, followed
363+
by a colon and a space and start with an imperative verb
362364
`Check <https://github.com/FRRouting/frr/tree/master/.github/commitlint.config.js>`_ all
363365
the supported subsystems.
366+
- Should not end with a period ``.``
367+
- should be a complete sentence
368+
- Should "make sense" when used with release changelog.
369+
- Think of the end-users reading it and write the title to them.
370+
- FRR maintainers should not need to rewrite the message to explain
371+
your work to end-users on your behalf.
364372

365-
- Commit messages must not end with a period ``.``
373+
Example good commit titles:
374+
375+
.. code-block:: console
376+
lib,bgpd: clean up clang warnings
377+
378+
babeld: convert all code to use our code formatting rules
379+
380+
doc: add commit message guidelines to the dev guide`
381+
382+
383+
The commit description should have more detailed explaination covering also the purpose
384+
of the work being done. Formatting guidelines include:
385+
386+
- Must be separated from the title by a blank line
387+
- Must be wrapped to 72 characters, unless it is a sample output
388+
- Markdown syntax/output code blocks (3 tickes "```" line before and after)
389+
- Write your commit message in the imperative: "Fix bug" and not "Fixed
390+
bug" or "Fixes bug." This convention matches up with commit messages
391+
generated by commands like git merge and git revert
392+
- Bullet points are okay, too
393+
- Typically a hyphen or asterisk is used for the bullet, followed by a
394+
single space. Use a hanging indent
395+
396+
Example good commit message:
397+
398+
.. code-block:: console
399+
pim6d: support embedded-rp
400+
401+
Implement embedded RP support and configuration commands.
402+
Embedded RP is disabled by default and can be globally enabled with the
403+
command `embedded-rp` in the PIMv6 configuration node.
404+
405+
It supports the following options:
406+
- Embedded RP maximum limit
407+
- Embedded RP group filtering
408+
409+
When opening a PR, please follow the same commit message guidelines above. Also
410+
make sure:
411+
- if the PR has a single commit, just copy the commit message as-is to the PR,
412+
which is the default behavior for a single commit PR on github.
413+
- If the PR has more than one commit, add a summary title for the whole PR
414+
along with a summary description encompassing all commits.
366415
367416
Why was my pull request closed?
368417
-------------------------------

0 commit comments

Comments
 (0)