-
Notifications
You must be signed in to change notification settings - Fork 52
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
document prompt for formatting good git-commit subjects. #232
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,8 @@ Find the [allowed types above](#Allowed-Values-for-Types). | |
|
||
An [imperative tone][365] is also helpful in conveying what a commit does, | ||
rather than what it did. For example, use **change**, not _changed_ or | ||
_changes_. | ||
_changes_. To put it another way: a good subject should complete this sentence: | ||
["when applied, this commit will..."][drew-devault-link] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this type of prompt is really helpful. I'm trying to put myself in the committer's shoes and see how this changes my instincts.
I'm not sure If we switched the wording a little to
It's not perfect either, but I felt like it took the focus away from what the commit does, which is clear in the diff. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like either prompt. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been trying out the above All this is to stay that I think I like I don't think we need a prompt for the body. We already mention that it should explain the "why". From the referenced article:
|
||
|
||
### Funtip | ||
|
||
|
@@ -327,3 +328,4 @@ Voila! You're done. You've successfully rebased a branch onto the master branch! | |
[example PR template]: ./PULL_REQUEST_TEMPLATE.md | ||
[example issue template]: ./ISSUE_TEMPLATE.md | ||
[Create a branch]: #naming-branches | ||
[drew-devault-link]: https://drewdevault.com/2019/02/25/Using-git-with-discipline.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you replace the word "message" with "subject" (like you did in the README) to help clarify the recommendation is not for commit body/footer?
From a similar article:
https://chris.beams.io/posts/git-commit/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do mention in the README here that the body should use an imperative tone, but it seems like this Chris Beams guy says it doesn't need to be as strict. https://github.com/sparkbox/standard/blob/ab244d2331a527eb12dbd05febd30ddb1b0b1cfc/code-style/git/README.md#the-body