Skip to content

Commit cea1c62

Browse files
committed
CODECONVENTIONS.md: Describe git commit messages conventions.
1 parent bc7ca7c commit cea1c62

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

CODECONVENTIONS.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
Git commit conventions
2+
======================
3+
4+
Each commit message should start with a directory or full file path
5+
prefix, so it was clear which part of codebase a commit affects. If
6+
a change affects one file, it's better to use path to a file. If it
7+
affects few files in a subdirectory, using subdirectory as a prefix
8+
is ok. For longish paths, it's acceptable to drop intermediate
9+
components, which still should provide good context of a change.
10+
It's also ok to drop file extensions.
11+
12+
Besides prefix, first line of a commit message should describe a
13+
change clearly and to the point, and be a grammatical sentence with
14+
final full stop. First line should fit within 78 characters. Examples
15+
of good first line of commit messages:
16+
17+
py/objstr: Add splitlines() method.
18+
py: Rename FOO to BAR.
19+
docs/machine: Fix typo in reset() description.
20+
ports: Switch to use lib/foo instead of duplicated code.
21+
22+
After the first line, add an empty line and in following lines describe
23+
a change in a detail, if needed. Any change beyond 5 lines would likely
24+
require such detailed description.
25+
26+
To get good practical examples of good commits and their messages, browse
27+
thry the `git log` of the project.
28+
129
Python code conventions
230
=======================
331

0 commit comments

Comments
 (0)