Git allows to specify a comment character different from the default
`#`. This is helpful when using markdown in commit messages, especially
when adding a user test section that has to start with `# User testing`
in order for the test bot to detect it.
This change modifies the `prepare-commit-msg` hook and adds a check for
a configured `core.commentString` or `core.commentChar`. If both are not
set it falls back to the default `#` character.
You can set a different comment character with
`git config core.commentChar //`.
Build-bot: skip
Test-bot: skip
Sometime ago we lost the ability to detect git remotes that use ssh
(git@github.com:keymanapp/keyman.git) and we only detect remotes that
use https (https://github.com/keymanapp/keyman.git). This change restores
this ability.
Also add some empty lines between the different parts of the error message.
# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
# Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
# Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
These changes come out of discussion in the team; we want to make use of
git trailers and improve the quality of our commit messages. Starting by
adding more hints to the commit suggestions. Includes some minor cleanup
of the hooks, and hopefully also improves tests so that they don't
interfere with interactions with non-Keyman repos.
Note: the scopes list may need maintenance as the list still includes
sub-scopes and 'oem'.
This change allows to add fixup commits by running the command
`git commit --fixup=<sha>` without complaining about the commit
message not being in conventional commit format. (Running the
git command will result in the commit title of the referenced
commit with `fixup!` prepended. It will later be squashed with
the referenced commit in a git rebase.)
If no scope is found in the branch name, then don't include the
parentheses around the scope, as this breaks automatic merge messages
and the parentheses are unnecessary.
This change allows a different project to override the definitions
by providing a local `commit-msg-defs` file while still sharing the
`commit-msg` hook. Other projects might have a different set of
scopes.
Adds support for conventional commit style validation of all commit
messages and makes configuration against all Keyman repos
straightforward with the configure-repo.sh script.