ci: decrease the minBodyLength commit message limit to 20 chars - #37949
#37949ci: decrease the minBodyLength commit message limit to 20 chars#37949IgorMinar wants to merge 1 commit intoangular:masterangular/angular:masterfrom IgorMinar:ci/minBodyLenth-set-to-20IgorMinar/angular:ci/minBodyLenth-set-to-20Copy head branch name to clipboard
Conversation
The motivation behind this change is to improve the productivity in the angular/angular repo without sacrificing the original goal of having better understanding of changes within the repo. When the minBodyLength limit was originally introduced the goal was simple: force committers to provide more contextual information for each change coming into the repo. Too often we found ourselves in a situation where nobody understood what motivated some of the changes and we needed more contextual info to know if the change was correct, desirable, and still relevant (at a later point in time). When the limit was introduced, we needed to pick a minimum body length - given no data, and frustration with even big changes being committed with just a words in the subject (along the lines of "fix(core): fixing a bug"), we overcompensated and started off with a really high bar of minBodyLength set to 100 chars. This turned out to be impractical and created a big friction point in making valid changes in the angular/angular repo, and in fact caused some of the refactorings and smaller changes to be either skipped or combined into other commits which increased the burden for code reviewers. The evidence in the friction points can be seen in the number of PRs that fail to pass the current lint check on the first try, but more importantly also in the "creative" writing that some of the committers are forced to resort to in order to satisfy the current checks. Examples: - angular@286fbf4 - angular@b2816a1 Given that we primarily care to document the motivation behind each change (the answer to the ultimate question: WHY?), I've collected several *common* & *valid* commit messages that are minimalistic and capture the WHY sufficiently: ``` Refactoring for readability. => 28 chars Improving variable naming. => 26 chars Additional test coverage. => 25 chars Cleaning up the code. => 21 chars Simplified the code. => 20 chars ``` These commit message bodies in addition to the commit message subject should sufficiently satisfy the need to capture the context and motivation behind each change without creating an undue burden on committers. Example minimalistic commit message: ------ refactor(core): cleanup the expression parser Simplifying the code. ---- Given this research, I'm decreasing the minBodyLenth in angular/angular to 20 chars. The commit message quality can be additionally improved by implementing a commit message template via `.gitmessage` that will guide the committers in following our commit message guidelines via instructions provided in the form of in-the-flow help rather than as an after the fact lint check. More info: https://thoughtbot.com/blog/better-commit-messages-with-a-gitmessage-template I'm intentionally deferring such change for a separate PR as not to complicate or delay the minBodyLength limit decrease.
ed8005e to
52df22a
Compare
petebacondarwin
left a comment
There was a problem hiding this comment.
I think at the end of the day, this is just a part of the reviewers' role - to ensure that the commit message actually adds value and provides context for future generations of maintainers.
I wonder how many people start their review of a PR by reading the commit message?
gkalpak
left a comment
There was a problem hiding this comment.
I love the idea of reducing the min body length 💯
I just wanted to point out that—according to the commit message guidelines—the commit message body should use imperative, present tense. So, Simplified the code. (20 chars) and Symplifying the code. (21 chars), which are shown as good examples, should be Simplify the code. (18 chars), which is less than 20 chars ![]()
On a more serious note, it might be a good idea to mention the body length requirement in the commit message guidelines (similar to how we mention the header length requirement). I wouldn't block this PR on this, though.
|
@gkalpak you are right as always. 😄 |
|
@IgorMinar Thank you. I always had trouble coming up with 100 chars for the commit message when making minor fixes. @gkalpak I can make the change in the commit guidelines. |
|
Thx for offering, @sonukapoor. @IgorMinar has already taken care of it 😉 EDIT: I now realize the guidelines update is on a different PR, so putting it here for reference: #37951 |
|
@sonukapoor thanks for offering, but as @gkalpak I updated the guidelines in #37951 - it's not ideal that the change is in a different PR but I didn't want to deal with merge conflicts between the two PRs. |
The motivation behind this change is to improve the productivity in the angular/angular repo without sacrificing the original goal of having better understanding of changes within the repo. When the minBodyLength limit was originally introduced the goal was simple: force committers to provide more contextual information for each change coming into the repo. Too often we found ourselves in a situation where nobody understood what motivated some of the changes and we needed more contextual info to know if the change was correct, desirable, and still relevant (at a later point in time). When the limit was introduced, we needed to pick a minimum body length - given no data, and frustration with even big changes being committed with just a words in the subject (along the lines of "fix(core): fixing a bug"), we overcompensated and started off with a really high bar of minBodyLength set to 100 chars. This turned out to be impractical and created a big friction point in making valid changes in the angular/angular repo, and in fact caused some of the refactorings and smaller changes to be either skipped or combined into other commits which increased the burden for code reviewers. The evidence in the friction points can be seen in the number of PRs that fail to pass the current lint check on the first try, but more importantly also in the "creative" writing that some of the committers are forced to resort to in order to satisfy the current checks. Examples: - 286fbf4 - b2816a1 Given that we primarily care to document the motivation behind each change (the answer to the ultimate question: WHY?), I've collected several *common* & *valid* commit messages that are minimalistic and capture the WHY sufficiently: ``` Refactoring for readability. => 28 chars Improving variable naming. => 26 chars Additional test coverage. => 25 chars Cleaning up the code. => 21 chars Simplified the code. => 20 chars ``` These commit message bodies in addition to the commit message subject should sufficiently satisfy the need to capture the context and motivation behind each change without creating an undue burden on committers. Example minimalistic commit message: ------ refactor(core): cleanup the expression parser Simplifying the code. ---- Given this research, I'm decreasing the minBodyLenth in angular/angular to 20 chars. The commit message quality can be additionally improved by implementing a commit message template via `.gitmessage` that will guide the committers in following our commit message guidelines via instructions provided in the form of in-the-flow help rather than as an after the fact lint check. More info: https://thoughtbot.com/blog/better-commit-messages-with-a-gitmessage-template I'm intentionally deferring such change for a separate PR as not to complicate or delay the minBodyLength limit decrease. PR Close #37949
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
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 #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 #37951
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 #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 #37951
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…lar#37949) The motivation behind this change is to improve the productivity in the angular/angular repo without sacrificing the original goal of having better understanding of changes within the repo. When the minBodyLength limit was originally introduced the goal was simple: force committers to provide more contextual information for each change coming into the repo. Too often we found ourselves in a situation where nobody understood what motivated some of the changes and we needed more contextual info to know if the change was correct, desirable, and still relevant (at a later point in time). When the limit was introduced, we needed to pick a minimum body length - given no data, and frustration with even big changes being committed with just a words in the subject (along the lines of "fix(core): fixing a bug"), we overcompensated and started off with a really high bar of minBodyLength set to 100 chars. This turned out to be impractical and created a big friction point in making valid changes in the angular/angular repo, and in fact caused some of the refactorings and smaller changes to be either skipped or combined into other commits which increased the burden for code reviewers. The evidence in the friction points can be seen in the number of PRs that fail to pass the current lint check on the first try, but more importantly also in the "creative" writing that some of the committers are forced to resort to in order to satisfy the current checks. Examples: - angular@286fbf4 - angular@b2816a1 Given that we primarily care to document the motivation behind each change (the answer to the ultimate question: WHY?), I've collected several *common* & *valid* commit messages that are minimalistic and capture the WHY sufficiently: ``` Refactoring for readability. => 28 chars Improving variable naming. => 26 chars Additional test coverage. => 25 chars Cleaning up the code. => 21 chars Simplified the code. => 20 chars ``` These commit message bodies in addition to the commit message subject should sufficiently satisfy the need to capture the context and motivation behind each change without creating an undue burden on committers. Example minimalistic commit message: ------ refactor(core): cleanup the expression parser Simplifying the code. ---- Given this research, I'm decreasing the minBodyLenth in angular/angular to 20 chars. The commit message quality can be additionally improved by implementing a commit message template via `.gitmessage` that will guide the committers in following our commit message guidelines via instructions provided in the form of in-the-flow help rather than as an after the fact lint check. More info: https://thoughtbot.com/blog/better-commit-messages-with-a-gitmessage-template I'm intentionally deferring such change for a separate PR as not to complicate or delay the minBodyLength limit decrease. PR Close angular#37949
The motivation behind this change is to improve the productivity in the angular/angular repo
without sacrificing the original goal of having better understanding of changes within
the repo.
When the minBodyLength limit was originally introduced the goal was simple: force
committers to provide more contextual information for each change coming into the
repo. Too often we found ourselves in a situation where nobody understood what
motivated some of the changes and we needed more contextual info to know if the
change was correct, desirable, and still relevant (at a later point in time).
When the limit was introduced, we needed to pick a minimum body length - given no
data, and frustration with even big changes being committed with just a words in
the subject (along the lines of "fix(core): fixing a bug"), we overcompensated
and started off with a really high bar of minBodyLength set to 100 chars.
This turned out to be impractical and created a big friction point in making valid
changes in the angular/angular repo, and in fact caused some of the refactorings
and smaller changes to be either skipped or combined into other commits which
increased the burden for code reviewers.
The evidence in the friction points can be seen in the number of PRs that fail to pass
the current lint check on the first try, but more importantly also in the "creative"
writing that some of the committers are forced to resort to in order to satisfy the
current checks. Examples:
Given that we primarily care to document the motivation behind each change
(the answer to the ultimate question: WHY?), I've collected several common &
valid commit messages that are minimalistic and capture the WHY sufficiently:
These commit message bodies in addition to the commit message subject should
sufficiently satisfy the need to capture the context and motivation behind each
change without creating an undue burden on committers.
Example minimalistic commit message:
Given this research, I'm decreasing the minBodyLenth in angular/angular to 20 chars.
The commit message quality can be additionally improved by implementing a commit message
template via
.gitmessagethat will guide the committers in following our commit messageguidelines via instructions provided in the form of in-the-flow help rather than as an after
the fact lint check.
More info: https://thoughtbot.com/blog/better-commit-messages-with-a-gitmessage-template
I'm intentionally deferring such change for a separate PR as not to complicate or delay the
minBodyLength limit decrease.