2019-11-09 18:30:06 +00:00
|
|
|
# Commit Message Format Policy # {#commit_messages}
|
2017-01-26 21:03:54 +00:00
|
|
|
|
|
|
|
[TOC]
|
|
|
|
|
2019-11-09 18:30:06 +00:00
|
|
|
Commit messages should begin with a brief subject line. Try to limit this
|
|
|
|
to no more than 72 characters. The body of the message should be separated
|
|
|
|
from the subject line by a blank line and wrapped at 72 characters. The body
|
|
|
|
of a commit message should explain what the commit does and why. Do not
|
|
|
|
explain *how* the changes work as the code itself should do that.
|
2017-01-26 21:03:54 +00:00
|
|
|
|
2019-12-01 09:44:04 +00:00
|
|
|
# Linking a commit to an issue # {#commit_bug_link}
|
2017-01-26 21:03:54 +00:00
|
|
|
|
2019-12-01 09:44:04 +00:00
|
|
|
If your commit fixes an issue that has been reported in the [issue
|
|
|
|
tracker](https://gitlab.com/kicad/code/kicad/issues), add a line indicating the
|
|
|
|
fixed issue number to your commit message. In such case, Gitlab will
|
|
|
|
automatically close the issue and add a link to your commit in the issue.
|
2017-01-26 21:03:54 +00:00
|
|
|
|
2019-12-01 09:44:04 +00:00
|
|
|
For example, the following line will automatically close issue #1234567:
|
|
|
|
|
2019-12-19 00:38:28 +00:00
|
|
|
Fixes https://gitlab.com/kicad/code/kicad/issues/1234567
|
2017-01-26 21:03:54 +00:00
|
|
|
|
2017-11-29 14:52:43 +00:00
|
|
|
There is an [alias](#commit_fixes_alias) to simplify this step.
|
2019-12-01 09:44:04 +00:00
|
|
|
You can read more about automatic issue closing in the
|
|
|
|
[Gitlab documentation](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically).
|
2017-01-26 21:03:54 +00:00
|
|
|
|
2017-11-29 09:44:47 +00:00
|
|
|
# Changelog tags {#commit_changelog_tag}
|
|
|
|
|
2019-11-09 18:30:06 +00:00
|
|
|
To facilitate following the code changes, you should include a changelog tag
|
|
|
|
to indicate modifications noticeable by the users. There are three types of
|
2017-11-29 09:44:47 +00:00
|
|
|
changelog tags:
|
|
|
|
|
2019-11-09 18:30:06 +00:00
|
|
|
- `ADDED` to denote a new feature
|
2017-11-29 09:44:47 +00:00
|
|
|
- `CHANGED` to indicate a modification of an existing feature
|
|
|
|
- `REMOVED` to inform about removal of an existing feature
|
|
|
|
|
|
|
|
There is no need to add changelog tags for commits that do not modify the way
|
2017-11-29 15:54:18 +00:00
|
|
|
the users interact with the software, such as code refactoring or a bugfix for
|
2019-11-09 18:30:06 +00:00
|
|
|
unexpected behavior. The main purpose of the changelog tags is to generate the
|
|
|
|
release notes and notify the documentation maintainers about changes. Keep that
|
2017-11-29 15:54:18 +00:00
|
|
|
in mind when deciding whether to add a changelog tag.
|
2017-11-29 09:44:47 +00:00
|
|
|
|
2019-11-09 18:30:06 +00:00
|
|
|
## Making the Documentation Developers Aware of Changes {#commit_let_doc_team_know}
|
|
|
|
|
|
|
|
When a commit with changelog tag is pushed, the committer should create a new
|
2017-11-29 09:44:47 +00:00
|
|
|
issue in the [documentation
|
|
|
|
repository](http://github.com/KiCad/kicad-doc/issues) to notify the
|
2019-11-09 18:30:06 +00:00
|
|
|
documentation maintainers. You should include a link to the commit containing
|
2017-11-29 09:44:47 +00:00
|
|
|
the reported changes.
|
|
|
|
|
2017-11-29 10:32:41 +00:00
|
|
|
## Extracting changelog {#commit_extract_changelog}
|
|
|
|
|
|
|
|
Thanks to the changelog tags, it is easy to extract the changelog using git
|
|
|
|
commands:
|
|
|
|
|
2019-11-09 18:30:06 +00:00
|
|
|
git log -E --grep="ADD[ED]?:|REMOVE[D]?:|CHANGE[D]?:" --since="1 Jan 2017"
|
|
|
|
git log -E --grep="ADD[ED]?:|REMOVE[D]?:|CHANGE[D]?:" <commit hash>
|
2017-11-29 10:32:41 +00:00
|
|
|
|
2019-11-09 18:30:06 +00:00
|
|
|
KiCad provides an [alias](#commit_changelog_alias) to shorten the changelog
|
|
|
|
extraction commands.
|
2017-11-29 10:32:41 +00:00
|
|
|
|
2017-01-26 21:03:54 +00:00
|
|
|
# Example # {#commit_example}
|
|
|
|
|
|
|
|
Following is an example of a properly formatted commit message:
|
|
|
|
|
2017-11-29 09:44:47 +00:00
|
|
|
Eeschema: Adding line styling options
|
2019-11-09 18:30:06 +00:00
|
|
|
|
|
|
|
ADDED: Add support in Eeschema for changing the default line style,
|
2017-11-29 09:44:47 +00:00
|
|
|
width and color on a case-by-case basis.
|
2019-11-09 18:30:06 +00:00
|
|
|
|
2017-11-29 09:44:47 +00:00
|
|
|
CHANGED: "Wire" lines now optionally include data on the line style,
|
|
|
|
width and color if they differ from the default.
|
2019-11-09 18:30:06 +00:00
|
|
|
|
2019-12-19 00:38:28 +00:00
|
|
|
Fixes https://gitlab.com/kicad/code/kicad/issues/594059
|
|
|
|
Fixes https://gitlab.com/kicad/code/kicad/issues/1405026
|
2017-11-29 10:32:41 +00:00
|
|
|
|
|
|
|
# Git aliases file # {#commit_git_aliases}
|
|
|
|
|
|
|
|
There is a file containing helpful git aliases located at
|
|
|
|
`helpers/git/fixes_alias`. To install it, run in the source repository:
|
|
|
|
|
|
|
|
git config --add include.path $(pwd)/helpers/git/fixes_alias
|
|
|
|
|
2017-11-29 14:52:43 +00:00
|
|
|
## 'fixes' alias # {#commit_fixes_alias}
|
2017-11-29 10:32:41 +00:00
|
|
|
|
2017-11-29 14:52:43 +00:00
|
|
|
Once the alias configuration file is installed, it may be used to amend the
|
|
|
|
most recent commit to include the bug report link:
|
2017-11-29 10:32:41 +00:00
|
|
|
|
|
|
|
git fixes 1234567
|
|
|
|
|
2019-12-01 09:44:04 +00:00
|
|
|
For example, the command below will append a line to the last commit message:
|
2017-11-29 10:32:41 +00:00
|
|
|
|
2019-12-19 00:38:28 +00:00
|
|
|
Fixes https://gitlab.com/kicad/code/kicad/issues/1234567
|
2017-11-29 10:32:41 +00:00
|
|
|
|
2017-11-29 14:52:43 +00:00
|
|
|
## 'changelog' alias # {#commit_changelog_alias}
|
2017-11-29 10:32:41 +00:00
|
|
|
|
2017-11-29 14:52:43 +00:00
|
|
|
With the alias configuration file installed, you get an alias to extract the changelog:
|
2017-11-29 10:32:41 +00:00
|
|
|
|
|
|
|
git changelog --since="1 Jan 2017"
|
|
|
|
git changelog <commit hash>
|