-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add style guidelines for commit messages #3752
Conversation
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.
While we're at it, maybe the README.md could use some cleaning up? Esp. the section "Development Status" looks outdated (and nobody looks here before they complain that they get an error caused by typeshed anyway).
@@ -112,6 +112,18 @@ Core developers should follow these rules when processing pull requests: | |||
* Use "[Squash and merge](https://github.com/blog/2141-squash-your-commits)" | |||
to merge PRs. | |||
* Delete branches for merged PRs (by core devs pushing to the main repo). | |||
* Edit the final commit message before merging to conform to the following | |||
style (we wish to have a clean `git log` output): | |||
* When merging a multi-commit PR make sure that the commit message doesn't |
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.
I would add something to make sure that if there's an issue being fixed to ensure that "Fixed #xxx" occurs. (And not in the title!)
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.
Added.
CONTRIBUTING.md
Outdated
output. | ||
* Split lines as needed so that the maximum line length of the commit | ||
message is under 80 characters. | ||
* Capitalize the header and each paragraph. |
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.
By header you mean the "subject" of the commit, appearing in its own text box, right? Maybe make this clearer. (OTOH maybe your workflow doesn't use GitHub's Squash Merge feature? I always use it. Maybe clarify this.)
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.
Updated to use "subject" since it seems to be the official term.
CONTRIBUTING.md
Outdated
* Split lines as needed so that the maximum line length of the commit | ||
message is under 80 characters. | ||
* Capitalize the header and each paragraph. | ||
* Make sure that the first line has no trailing dot. |
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.
And here "first line" refers to that same "subject"?
* When merging a multi-commit PR make sure that the commit message doesn't | ||
contain the local history from the committer and the review history from | ||
the PR. Edit the message to only describe the end state of the PR. | ||
* Make sure there is a *single* newline at the end of the commit message. |
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.
Or none? AFAIK git always gives you one for free.
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.
I believe that if you don't provide a newline, the output from git log
looks like this:
Author: David Ross <[email protected]>
Date: Fri Jul 21 12:37:47 2017
Support exported names starting with an underscore in __all__ (#3746)
Fixes #3745 <--- no empty line after this
commit c4b4949dc471b44b1aa2275d9a564ef01a4ab396
Author: Svyatoslav Ilinskiy <[email protected]>
Date: Fri Jul 21 01:02:09 2017
I'd prefer this:
Author: David Ross <[email protected]>
Date: Fri Jul 21 12:37:47 2017
Support exported names starting with an underscore in __all__ (#3746)
Fixes #3745
<--- empty line between commits
commit c4b4949dc471b44b1aa2275d9a564ef01a4ab396
Author: Svyatoslav Ilinskiy <[email protected]>
Date: Fri Jul 21 01:02:09 2017
I created a separate PR to update the development status (#3753). |
@ddfisher note these new guidelines for commit messages. |
No description provided.