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

Include commit message format in contributing guidelines #5943

Merged
merged 1 commit into from
Mar 31, 2017

Conversation

dinatale2
Copy link
Contributor

Add the need to have a commit message with a specific
format to the contributing guidelines.

Signed-off-by: Giuseppe Di Natale [email protected]

@gmelikov
Copy link
Member

Some OpenZFS commits have more than 50 characters in first line, what shall we do in this case? (in context with openzfs/zfs-buildbot#68 )

@dinatale2
Copy link
Contributor Author

@gmelikov I'm planning to do different checks if the commit message is an OpenZFS port. @behlendorf had similar concerns. It may be worth mentioning that OpenZFS port commit message are different and provide a sample commit message for one.

@dinatale2 dinatale2 force-pushed the contrib-changes branch 6 times, most recently from 7fd7881 to 47ffbc2 Compare March 29, 2017 16:30
@dinatale2
Copy link
Contributor Author

@gmelikov @behlendorf I refreshed this to have a section on OpenZFS port commit messages. Would both of you mind looking over it?

approach was chosen or a brief description of the bug you are resolving.
Each line of the body must be 70 characters or less.
* The last line must be a `Signed-off-by:` line with the developer's
name followed by their Github ID or email.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An email address is preferable to their Github ID.


#### OpenZFS Patch Ports
If you are porting an OpenZFS patch, the commit message must meet
the following guidelines:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure this agrees with what's already described on the wiki, https://github.com/zfsonlinux/zfs/wiki/OpenZFS-Patches. We should also update the wiki to describe cherry-picking patches from an OpenZFS remote since it's a simpler method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor question - do we need to duplicate this information here? Maybe just make a link to wiki page?

Copy link
Contributor Author

@dinatale2 dinatale2 Mar 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends which we think is appropriate. Maybe it's time to make the contributing guidelines the authoritative document for these types of things? Then the wiki can refer to it when appropriate?

Thoughts on that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we should have this in one place and the guidelines make the most sense to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -29,4 +29,5 @@
- [ ] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] All commit messages are properly formatted.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

including adding your signed-off-by.


#### OpenZFS Patch Ports
If you are porting an OpenZFS patch, the commit message must meet
the following guidelines:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor question - do we need to duplicate this information here? Maybe just make a link to wiki page?

@dinatale2 dinatale2 force-pushed the contrib-changes branch 3 times, most recently from 327a245 to dca5277 Compare March 29, 2017 23:50
@dinatale2
Copy link
Contributor Author

@behlendorf @gmelikov Refreshed again. I'm providing the commit check script in the zfs tree and have a make target for it. You can now run make commitcheck to test the commit pointed to by HEAD.

@dinatale2 dinatale2 force-pushed the contrib-changes branch 3 times, most recently from d39ae2c to 59605c4 Compare March 30, 2017 00:10
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As justification for this let's reference one of the many posts explaining why enforcing this git style is a good idea. For example, https://chris.beams.io/posts/git-commit/ which also includes a short list of basic rules.

The seven rules of a great git commit message

Separate subject from body with a blank line
Limit the subject line to 50 characters
Capitalize the subject line
Do not end the subject line with a period
Use the imperative mood in the subject line
Wrap the body at 72 characters
Use the body to explain what and why vs. how

Makefile.am Outdated
commitcheck:
@if git rev-parse --git-dir > /dev/null 2>&1; then \
scripts/commitcheck.sh; \
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should be tabs not spaces

function test_url()
{
url="$1"
if ! curl --output /dev/null --max-time 60 --silent --head --fail "$url" ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra space after !

# check commit message for a normal commit
function new_change_commit()
{
RC=0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think replacing RC with error would be clearer, s/RC/error/g

RC=1
fi

# ensure that no lines in the body of the commit are over 70 characters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So actually 72 characters is the recommended limit.

@dinatale2
Copy link
Contributor Author

@behlendorf Updated. Did you want me to include a copy of the rules in the contributing guidelines? I only provided a link to the page as further reading.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just providing the link as additional reading is good.

Add the need to have a commit message with a specific
format to the contributing guidelines. Provide a script
to help enforce commit message style.

Signed-off-by: Giuseppe Di Natale <[email protected]>
@behlendorf behlendorf merged commit cb524aa into openzfs:master Mar 31, 2017
@dinatale2 dinatale2 deleted the contrib-changes branch March 31, 2017 20:59
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