Conversation
Hopefully this will result in commit messages that are more valuable when you dig back in the code history.
Summary of ChangesHello @runephilosof-abtion, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new documentation file dedicated to establishing best practices for writing commit messages. The primary aim is to enhance the clarity and value of the project's commit history, making it easier for developers to understand the rationale and context behind code changes. By providing clear guidelines, this change seeks to improve long-term maintainability and collaboration. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds valuable documentation on writing good commit messages. I've suggested a more structured format for the document to make the guidelines clearer and more actionable for developers. The proposed structure includes sections for the headline, body, and footer of a commit, and also adds references to common conventions like using the imperative mood and the Conventional Commits specification. This should help achieve the goal of making commit history more valuable.
| # Commit Messages | ||
|
|
||
| The most important information in commit messages is *why* you made the change. | ||
|
|
||
| Nice to have: | ||
|
|
||
| * Summary of the changes (it helps when going back in history and trying to decide whether a change was accidentally added to commit). | ||
| * Thoughts about decisions you made. | ||
| * Links to Asana task, or other relevant info like a Github bug report, stackoverflow, etc. | ||
| * Keep the headline less than 50 characters, if possible. | ||
|
|
||
| https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/ | ||
| > To come up with thoughtful commits, consider the following: | ||
| > * Why have I made these changes? | ||
| > * What effect have my changes made? | ||
| > * Why was the change needed? | ||
| > * What are the changes in reference to? |
There was a problem hiding this comment.
This is a great start for documenting commit message best practices. To make it even more effective and easier for developers to follow, I suggest restructuring the entire document. A more formal structure with sections for Headline, Body, and Footer can provide clearer, actionable guidance. This revised structure incorporates all your original points while also adding other common best practices, like using the imperative mood and linking to the Conventional Commits standard. It also aligns the formatting with other documentation files in the repository by using a 'Further reading' section.
# Commit Messages
The most important information in a commit message is *why* you made the change. A well-crafted commit message is a gift to your future self and your teammates.
## Structure of a good commit message
A commit message consists of a headline (or subject), an optional body, and an optional footer.
### Headline
The headline should be a concise summary of the change.
* Keep it under 50 characters if possible.
* Write it in the imperative mood (e.g., "Fix login bug" not "Fixed login bug").
### Body (Optional but recommended)
The body is where you explain the context and the *why*.
* Explain the problem this change is solving.
* Describe the decisions you made and their rationale.
* Summarize the changes if the headline isn't sufficient.
### Footer (Optional)
The footer is for metadata.
* Link to Asana tasks, GitHub issues, or other relevant resources (e.g., `Fixes #123`, `Refs: ASANA-456`).
## Guiding Questions
To help write a thoughtful commit message, consider these questions:
* Why is this change necessary?
* How does it address the issue?
* What effects does this change have?
## Further reading
* [How to Write Better Git Commit Messages](https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/)
* [Conventional Commits](https://www.conventionalcommits.org/)
Hopefully, this will result in commit messages that are more valuable when you dig back in the code history.