-
Notifications
You must be signed in to change notification settings - Fork 184
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
Establishing Commit Message Guidelines #2281
Comments
@iamniting In rook we use commitlint github action which use this configuration https://github.com/rook/rook/blob/master/.commitlintrc.json for commit title and description |
@nbalacha @jarrpa @umangachapagain @travisn @obnoxxx @agarwal-mudit @raghavendra-talur @ShyamsundarR Can you pls provide your thoughts as well? |
I would summarize my main concerns about commit messages into two points:
Beyond those two points which really need to be enforced by maintainers rather than CI tools, the formatting restrictions are less important to me. |
Most of the 72 char restrictions for the length of the description lines appear to date back several years and were introduced to work with the tools available at that time. If the tools used now no longer have such restrictions, we could do away with the max 72 char requirement for description lines. |
I tend to agree with @travisn IMHO a commit message linter is needed only when there are restrictions to be applied for example:
If such rules need to be enforced a linter is useful, such that the feedback is from a tool rather than a person and also a reviewer need not (mostly) worry about the rules as such. Beyond that a simple subject/body for EACH commit should be reviewed for correctness by the reviewer anyway, and if there are commit message guidelines (like the post you mention above @iamniting ) just make sure it is part of the CONTRIBUTING or such guide, such that the reviewer can point to the same for an acceptable practice. (my bigger nit is smaller commits and a commit chain that is bisect-able, but that is a different topic) |
I like the idea of writing down commit message requirements. But reviewing it now, I thought that we had added more details when we originally created the guide. somehow, it seems to have been lost in the cracks of time ... So let's expand it! for comparison, the samba-operator project has more details: for linting the commit message formatting, the project tried commitlint first, as recommended by the rook project, but it was found to be too picky for no good reason, and then samba-operator chose gitlint for commit message linting instead. This is very successful so far. Apart from formatting requirements, for me the content of the commit message is usually more important. I prefer to see the following points covered:
these points can hardly be covered by automatic linters but have to be checked by reviewers. FWIW, I usually apply similar criteria to code commits to avoid pointless comments Just a few cents of mine ... |
Others have already chimed in with the suggestions I would have had. About the char limits for the subject and body, I think we don't need to restrict it to a very low number like 50(helpful when patches are reviewed in a email client). However, it is always good to have a agreed upon number which suits the tools currently used. A higher char limit like 120 or 150(which suits github reviews on a typical resolution monitor) is good. |
We want to keep our commit messages and git history neat and organized. I usually follow the guidelines in [1], except for the title length, which is suggested to be 50 characters. Personally, I find 72 characters more practical. I've noticed differing opinions on how to write the commit messages. I'd love to hear from everyone about how they approach writing commit messages and what they think is the best way. Let's discuss and decide on the most effective approach together!
[1] https://cbea.ms/git-commit/
The text was updated successfully, but these errors were encountered: