To ensure consistency and clarity in our Git workflow, follow these rules for commit messages and branch names.
When creating commit messages, include an appropriate tag at the beginning of the message.
Name | Code | Description |
---|---|---|
New Module | [NEW] | Use when creating new modules |
Refactoring | [REF] | Code works fine but is reorganized for better structure or maintainability |
Critical Fixes | [FIX] | Fixes issues that previously caused incorrect behavior |
Feature Improvement | [IMP] | Enhancements in performance or addition of new functionality |
Views and Templates | [VIEW] | Changes to views, QWeb templates, or assets |
Demo Data | [DEMO] | Updates related to demo data |
Data Files | [DATA] | Updates related to data records |
Access Rights | [ACC] | Updates to security and access rights |
Documentation | [DOC] | Updates to .rst files, static/description , or manifest |
Pricing Updates | [PRICE] | Changes in the pricing information in the manifest |
Translations | [I18N] | Updates or additions to translations |
Tests | [TEST] | Updates related to tests |
Linting | [LINT] | Fixing linting issues (e.g., spacing, unused imports, formatting) |
Porting | [PORT] | Porting a module to a new Odoo version |
Removal | [DEL] | Removal of modules or obsolete code |
Commit messages must follow this format:
[ODOO_VERSION: e.g., 16.0][TAG] <module_name>: #<ISSUE_LINK> Short Description
[16.0][IMP] web_notify: #12345 Add sound to notifications
- One Commit Per Module: A single commit should only include changes related to one module. If multiple modules are affected, create separate commits for each module.
- Issue Linking: Include the task or issue number and, if possible, a direct link to the issue.
- Short (50 characters or less without including module name, task number, tag, and Odoo version) and descriptive.
- Written in the imperative mood (e.g., "Fix bug", "Add feature" rather than "Fixed" or "Added").
[16.0][FIX] my_custom_module:issue#123 fee calculation
- Must be separated from the title with a blank line.
- Wrap at 72 characters per line for readability.
- Must explain what and why of the change (if not self-explanatory).
- Can mention how only if necessary for clarification.
Branches should be named using the following format:
<ODOO_VERSION>-t<TASK_OR_ISSUE_NUMBER>-<MODULE_NAME>-<TAG>-<SHORT_DESCRIPTION>
16.0-t12345-web_notify-IMP-add-sound-to-notifications
- Task or Issue Number: Include the task or issue number to link the branch to the related work item.
- Descriptive Names: Keep the branch name descriptive yet concise.
- Use Tags: Use one of the defined tags to specify the type of work being done.
- Use the strongest applicable tag when merging commits.
- Ensure that commits and branch names are aligned with the task they address to maintain traceability.