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

Add style guidelines for commit messages #3752

Merged
merged 2 commits into from
Jul 21, 2017
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jul 21, 2017

No description provided.

Copy link
Member

@gvanrossum gvanrossum left a 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
Copy link
Member

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!)

Copy link
Collaborator Author

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.
Copy link
Member

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.)

Copy link
Collaborator Author

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.
Copy link
Member

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.
Copy link
Member

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.

Copy link
Collaborator Author

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

@JukkaL
Copy link
Collaborator Author

JukkaL commented Jul 21, 2017

I created a separate PR to update the development status (#3753).

@gvanrossum gvanrossum merged commit 6c8294b into master Jul 21, 2017
@gvanrossum gvanrossum deleted the commit-message-guideline branch July 21, 2017 17:38
@JukkaL
Copy link
Collaborator Author

JukkaL commented Jul 21, 2017

@ddfisher note these new guidelines for commit messages.

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

Successfully merging this pull request may close these issues.

3 participants