-
Notifications
You must be signed in to change notification settings - Fork 23
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
Standardise commit messages #16
Comments
I totally agree. I've also started using this convention some months ago, and I feel that it really improves the readability of commits. We could use husky and commitlint to enforce the message format: |
I always follow this one: Depending on the project, with 1 change - include the ticket number in the subject line. This makes the commit log easier to scan related to specific tickets. Regarding your link The The thing they have in common should be followed anyway, since they are a big improvement over what some people come up with :D We could see if we can pick an existing standard from https://github.com/commitizen/cz-cli#adapters (or create our own template(s) to better integrate with the tools we use) - but should also look how people commit using their editors (webstorm/vscode) or git tools (sourcetree, tortoisegit, etc) |
I like the idea of standardizing commit messages. However writing a commit message like this doesn't mean it's good or helpful. For me knowing why something is changed is more important than seeing what is changed. Your example |
Yeah that makes sense. Ticket numbers are indeed super helpful. Maybe the explanation of why something was done a certain way can be added to the body of the commit? I use titles more of a summary of all the changes that have occurred and if I want to know more about a specific commit I will check the description. The only thing is (myself included) most of the time people only write a commit title so it might get some getting use to to also write a description |
You need both:
|
Regarding enforcing commit message style. Husky is usually installed in new projects, we can create a pre-commit hook to enforce a certain commit message styling.
The script doesn't have to be too complex. This is something I've created for a project I've been working on. It checks if the ticket matches a pattern so that we can find it in Jira.
Conveniently bitbucket is also linked in that project, this makes tracking changes a lot easier us and PMs. I've worked on projects where a hook also checks if the ticket id actually exists by eg. connecting to the Jira API (https://jira.atlassian.net/rest/api/latest/issue/MYPROJECT-123) |
I'm not sure if this is something for the coding standards but I like to have a look at this. I think it's a good idea to put some sort of standardisation on commit messages.
I personally try to follow the angular way of writing commit messages, which can be read here Angular Commit Messages
The commit message looks like the following:
<type>(<scope>): <subject>
Pros
Cons
I would like to hear everybody's thoughts on this.
The text was updated successfully, but these errors were encountered: