Skip to content

Commit

Permalink
build: add .gitmessage file with commit message template (angular#37951)
Browse files Browse the repository at this point in the history
Git provides a way to create a commit message template via the `.gitmessage` file.

Introduce an Angular-specific .gitmessage template based on the original Commit Message Guidelines.
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines

If this template workflow is proven in practice, we can move the commit message guidelines into the
.gitmessage file to prevent duplication of the content.

This change is a follow up on angular#37949 and is inspired by info found in the following blog post:
https://thoughtbot.com/blog/better-commit-messages-with-a-gitmessage-template

PR Close angular#37951
  • Loading branch information
IgorMinar authored and atscott committed Jul 13, 2020
1 parent f66f4a1 commit 53d4859
Show file tree
Hide file tree
Showing 2 changed files with 234 additions and 49 deletions.
145 changes: 145 additions & 0 deletions .gitmessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<type>(<scope>): <summary>

<Describe the motivation behind this change - explain WHY you are making this change. Wrap all lines
at 100 characters.>

Fixes #<issue number>

# ────────────────────────────────────────── 100 chars ─────────────────────────────────────────────


# Example Commit Messages
# =======================


# ─── Example: Simple refactor ─────────────────────────────────────────────────────────────────────
# refactor(core): rename refreshDynamicEmbeddedViews to refreshEmbeddedViews
#
# Improve code readability. The original name no longer matches how the function is used.
# ──────────────────────────────────────────────────────────────────────────────────────────────────


# ─── Example: Simple docs change ──────────────────────────────────────────────────────────────────
# docs: clarify the service limitation in providers.md guide
#
# Fixes #36332
# ──────────────────────────────────────────────────────────────────────────────────────────────────


# ─── Example: A bug fix ───────────────────────────────────────────────────────────────────────────
# fix(ngcc): ensure lockfile is removed when `analyzeFn` fails
#
# Previously an error thrown in the `analyzeFn` would cause the ngcc process to exit immediately
# without removing the lockfile, and potentially before the unlocker process had been successfully
# spawned resulting in the lockfile being orphaned and left behind.
#
# Now we catch these errors and remove the lockfile as needed.
# ──────────────────────────────────────────────────────────────────────────────────────────────────


# ─── Example: Breaking change ─────────────────────────────────────────────────────────────────────
# feat(bazel): simplify ng_package by dropping esm5 and fesm5
#
# esm5 and fesm5 distributions are no longer needed and have been deprecated in the past.
#
# https://v9.angular.io/guide/deprecations#esm5-and-fesm5-code-formats-in-angular-npm-packages
#
# This commit modifies ng_package to no longer distribute these two formats in npm packages built by
# ng_package (e.g. @angular/core).
#
# This commit intentionally doesn't fully clean up the ng_package rule to remove all traces of esm5
# and fems5 build artifacts as that is a bigger cleanup and currently we are narrowing down the
# scope of this change to the MVP needed for v10, which in this case is 'do not put esm5 and fesm5'
# into the npm packages.
#
# More cleanup to follow: https://angular-team.atlassian.net/browse/FW-2143
#
# BREAKING CHANGE: esm5 and fesm5 format is no longer distributed in Angular's npm packages e.g.
# @angular/core
#
# Angular CLI will automatically downlevel the code to es5 if differential loading is enabled in the
# Angular project, so no action is required from Angular CLI users.
#
# If you are not using Angular CLI to build your application or library, and you need to be able to
# build es5 artifacts, then you will need to downlevel the distributed Angular code to es5 on your
# own.
#
#
# Fixes #1234
# ──────────────────────────────────────────────────────────────────────────────────────────────────



# Angular Commit Message Format
# =============================
#
# The full specification of the Angular Commit Message Format can be found at
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
#
# The following is an excerpt of the specification with the most commonly needed info.
#
# Each commit message consists of a *header*, a *body*, and a *footer*.
#
# <header>
# <BLANK LINE>
# <body>
# <BLANK LINE>
# <footer>
#
# The header is mandatory.
#
# The body is mandatory for all commits except for those of scope "docs". When the body is required
# it must be at least 20 characters long.
#
# The footer is optional.
#
# Any line of the commit message cannot be longer than 100 characters.
#
#
# Commit Message Header
# ---------------------
#
# <type>(<scope>): <short summary>
# β”‚ β”‚ β”‚
# β”‚ β”‚ └─⫸ Summary in present tense. Not capitalized. No period at the end.
# β”‚ β”‚
# β”‚ └─⫸ Commit Scope: animations|bazel|benchpress|common|compiler|compiler-cli|core|
# β”‚ elements|forms|http|language-service|localize|platform-browser|
# β”‚ platform-browser-dynamic|platform-server|platform-webworker|
# β”‚ platform-webworker-dynamic|router|service-worker|upgrade|zone.js|
# β”‚ packaging|changelog|dev-infra|docs-infra|migrations|ngcc|ve
# β”‚ https://github.com/angular/angular/blob/master/CONTRIBUTING.md#scope
# β”‚
# └─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|style|test
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type
#
#
# Commit Message Body
# ---------------------
#
# Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".
#
# Explain the motivation for the change in the commit message body. This commit message should
# explain WHY you are making the change. You can include a comparison of the previous behavior with
# the new behavior in order to illustrate the impact of the change.
#
#
# Commit Message Footer
# ---------------------
#
# The footer can contain information about breaking changes and is also the place to reference
# GitHub issues, Jira tickets, and other PRs that this commit closes or is related to.
#
# ```
# BREAKING CHANGE: <breaking change summary>
# <BLANK LINE>
# <breaking change description + migration instructions>
# <BLANK LINE>
# <BLANK LINE>
# Fixes #<issue number>
# ```
#
# Breaking Change section should start with the phrase "BREAKING CHANGE: " followed by a summary of
# the breaking change, a blank line, and a detailed description of the breaking change that also
# includes migration instructions.
#
Loading

0 comments on commit 53d4859

Please sign in to comment.