diff --git a/packages/dnb-design-system-portal/src/docs/contribute/getting-started/commit-changes.mdx b/packages/dnb-design-system-portal/src/docs/contribute/getting-started/commit-changes.mdx index 9ef6519554c..2f750aff5e2 100644 --- a/packages/dnb-design-system-portal/src/docs/contribute/getting-started/commit-changes.mdx +++ b/packages/dnb-design-system-portal/src/docs/contribute/getting-started/commit-changes.mdx @@ -12,12 +12,16 @@ From a Fork: - Make your changes in your Fork and create a _Pull Request_ back to the Eufemia repo and `origin/main`. - Watch the result of the tests. -From a clone: +With access to the Eufemia repo: - Make your changes and commit it to the repo in a new branch. - Make a _Pull Request_ to `origin/main`. - Watch the result of the tests. +## How to write a commit message + +Please have a look at the [Git convention](/contribute/style-guides/git) for how to write a commit message. + ## Submit Algolia search queries locally In order to submit Algolia search queries to the `dev_eufemia_docs` index, you have to: diff --git a/packages/dnb-design-system-portal/src/docs/contribute/style-guides/git.mdx b/packages/dnb-design-system-portal/src/docs/contribute/style-guides/git.mdx index d5986390fc5..e4a8fe7deb0 100644 --- a/packages/dnb-design-system-portal/src/docs/contribute/style-guides/git.mdx +++ b/packages/dnb-design-system-portal/src/docs/contribute/style-guides/git.mdx @@ -13,11 +13,27 @@ Version numbers are handled automatically by using [semantic-release](https://gi ## Commit Messages -Make sure to decorate your **commit messages** with either [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) or [simple-commit-message](https://github.com/bahmutov/simple-commit-message): +For consistency, please write commit messages in the **imperative mood**. -- `fix: an example fix message` as the subject -- `feat: this is a new feature` as the subject -- `e.g. feat: message` + `BREAKING CHANGE:` in the footer of the commit. See example below. +A clear and concise commit message helps others understand the purpose of the commit and makes it easier to search through the history for specific changes. + +### Why the Imperative Mood? + +The imperative mood matches the implied "command" to the codebase. Think of the message as completing the phrase: _"This commit will..."_. For example: + +- **"Fix bug"** (instead of "Fixed bug") +- **"Add feature"** (instead of "Added feature") +- **"Refactor code"** (instead of "Refactored code") + +This convention helps maintain consistency and clarity across the Eufemia codebase. + +### Decorate your commit messages + +Make sure to **decorate** your commit messages with either [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) or [simple-commit-message](https://github.com/bahmutov/simple-commit-message): + +- `fix: fix message` as the subject +- `feat: feature message` as the subject +- For a major change: `feat: message` + `BREAKING CHANGE:` in the footer of the commit. See example below. If you are working on a single component update, you can use a decoration and a scope in parenthesis: