Semantic Commit Cheatsheet #9
Replies: 1 comment
-
Merging #5 as the request for review has timed out. Reviewers: Kindly review the changes to ensure you're up-to-date. On a related note, I recently merged pull request #10, which contained a substantial number of changes bundled into single commits. Moving forward, I'd like to emphasize the importance of crafting atomic commits for each distinct change. By keeping your changes small and distinct, we can enhance code reviews, ease browsing through the history, and simplify reverting changes when needed. For instance, if you install a new package, that action should constitute its own commit. I recommend using Git's interactive mode ( Before you commit, you can use If you're unfamiliar with atomic commits, consider this your homework. Please refer to the resources I've shared and make sure you understand how to apply these principles in your work. Maintaining an organized and clear commit history is crucial for the productivity of our team, and it's a responsibility we all share. Thank you for your cooperation and commitment to improving our development practices. Docs
|
Beta Was this translation helpful? Give feedback.
-
Style Guide
Semantic commits are a best practice for writing clear and informative commit messages that follow a standardized format. These commits make it easier for developers to understand the purpose and impact of each commit, facilitating collaboration and code maintenance. In this cheatsheet, a comprehensive reference guide on how to write semantic commits using the conventional format is presented.
Commit Types
Start by selecting a commit type that best describes the nature of the changes made. Choose the appropriate type from the table below:
Examples:
Providing a Scope (optional)
If the commit affects a specific component or module within the TenantTalk project, provide a scope to indicate which part of the project is impacted. The scope should be a short descriptor of the component or module affected. For example, if your changes are related to the user authentication system, you might use
auth
as the scope.Helping Questions for Scope:
Examples:
Writing a Short Description
Write a concise summary of the changes made. Begin with a present-tense verb and use sentence case. The short description should be a brief summary of the changes, ideally not exceeding 50 characters.
Helping Questions for Short Description:
Examples:
Adding Additional Details (optional)
If needed, provide additional context or details about the changes made. This can include the reasoning behind the changes, the impact of the changes, or any other relevant information that would help other developers understand the commit.
Helping Questions for Additional Details:
Examples:
Referencing Issues (optional)
If the commit is related to a specific issue or task tracked in an issue tracking system, reference it by including the issue number or ID. This can help link the commit to the relevant discussion or task, providing additional context and facilitating tracking of project progress.
Helping Questions for Referencing Issues:
issues that this commit is addressing or related to?
Examples:
FAQ
Q: What if my changes include multiple types?
If your changes involve multiple types (e.g., introducing a new feature and fixing a bug), it's recommended to split them into separate commits, each focusing on a specific type of change. This helps keep the commit history clear and allows for better tracking of changes.
Q: Can I add my own commit types or emojis?
While the provided commit types and emojis cover common scenarios, you can customize them to better suit your project's needs. Ensure that the commit types and emojis remain consistent across the team to maintain clarity and avoid confusion.
Q: Is providing a scope always necessary?
Providing a scope is not always necessary, but it can be helpful in providing additional context about the changes made. If the commit affects a specific component or module within the project, it's beneficial to include a scope.
Q: What are the benefits of using semantic commit messages?
Semantic commit messages can help in conveying complex information simply. They set the stage, frame the issues, and provide detailed analysis that feeds into the larger decision-making process. They also help in independent development, making correctness proofs easier to derive, increasing potential reusability, reducing maintenance costs, and making the code less error-prone.
Q: What are the common mistakes to avoid when writing commit messages?
Common mistakes to avoid when writing commit messages include not providing a clear and concise summary of the changes made, not using the present tense, not including a scope when necessary, and not referencing related issues or tasks. It's also important to avoid writing commit messages that are too long or too short, as they may not provide enough context or detail about the changes made.
The goal of a commit message is to provide clear, concise, and relevant information about the changes made. It should be easy to understand and provide enough context for anyone reading it to understand the purpose and impact of the changes. Ko
Beta Was this translation helpful? Give feedback.
All reactions