Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write a template for commit messages. #2

Open
amtoine opened this issue May 24, 2022 · 0 comments
Open

Write a template for commit messages. #2

amtoine opened this issue May 24, 2022 · 0 comments

Comments

@amtoine
Copy link
Member

amtoine commented May 24, 2022

Once an issue has been opened, its topic discussed and the development of the feature or the bug fix accepted, a branch should be created.

Motivations for the template:
A great proportion of what will be seen from the outside of the branch will be the commit list. These have to be nice to read, concise and complete enough to give insights on the choices made by the developer.
A great way to encourage the authors of git commits to write "good" commit is to use a git commit template.

Disclaimer:
The definition of what a "good" git commit is is probably ill defined and is out of the scope of that issue. The idea of such a template, that could be adapted from project to project, is to allow the developers of the same project to write consistent git commits throughout the git worktree, not to impose a single, narrow view of what a commit should be.

A first idea:
I found a pretty nice template here, but it has to be adapted of course!
Since the beginning of my internship this year, I have been using the following template, which has the benefit of being super small for what it's doing.

# ----------------------------------------------------------
# Header - (type): Brief description
# ----------------------------------------------------------
#   * feat         A new feature
#   * fix          A bug fix
#   * docs         Changes to documentation only
#   * style        Style/format changes (whitespace, etc.)
#   * refactor     Changes not related to a bug or feature
#   * perf         Changes that affects performance
#   * test         Changes that add/modify/correct tests
#   * build        Changes to build system (configs, etc.)
#   * ci           Changes to CI pipeline/workflow
# ----------------------------------------------------------


# ----------------------------------------------------------
# Body - More detailed description, if necessary
# ----------------------------------------------------------
#   * Motivation behind changes, more detail into how
# functionality might be affected, etc.
# ----------------------------------------------------------


# ----------------------------------------------------------
# Footer - Associated issues, PRs, etc.
# ----------------------------------------------------------
#   * Ex: Resolves Issue #207, see PR #15, etc.
# ----------------------------------------------------------

Notes:
A tutorial on how to install the template locally will be needed, e.g. in the README.
Note that git commit templates can be defined locally, for a single repo. There is no need to force a given template on other projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant