You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Request: Extract Issue Name from Branch and Append to Commit Message
Overview
For developers who follow a naming convention for their branches that includes an issue name or identifier, it would be beneficial for the ai-commit tool to automatically extract this issue name and append it to the generated commit message. This ensures that each commit is directly associated with the relevant issue, providing better traceability and context.
Current Behavior
Currently, when using the ai-commit tool, the generated commit message is in the format:
<commit_msg>
Desired Behavior
Given a branch name that follows the convention feature/abc-576, bugfix/abc-577, etc., the tool should extract the issue name (e.g., abc-576) and append it to the commit message. The resulting commit message should be:
abc-576 <commit_msg>
Use Case
Consider a developer working on a feature branch named feature/abc-576. They make some changes and stage them. When they use the ai-commit tool to generate a commit message, the tool should:
Detect the current branch name.
Extract the issue name from the branch name.
Append the issue name to the generated commit message.
For example, if the AI-generated commit message is "Added new login functionality", the final commit message should be:
abc-576 Added new login functionality
Implementation Suggestions
Use Git commands to detect the current branch name.
Use regular expressions or string manipulation to extract the issue name from the branch name.
Append the issue name to the AI-generated commit message.
Benefits
Traceability: By associating commits with specific issues, developers and teams can easily trace changes back to their originating requirements or bug reports.
Context: When reviewing commit histories, having the issue name directly in the commit message provides immediate context about the purpose of the change.
Integration with Other Tools: Many project management and CI/CD tools can utilize the issue name in the commit message for better automation and linking of code changes to tasks.
Alternatives
I am editing the commit message in this way right now,
git commit --amend
And I am pushing it.
The text was updated successfully, but these errors were encountered:
Feature Request: Extract Issue Name from Branch and Append to Commit Message
Overview
For developers who follow a naming convention for their branches that includes an issue name or identifier, it would be beneficial for the
ai-commit
tool to automatically extract this issue name and append it to the generated commit message. This ensures that each commit is directly associated with the relevant issue, providing better traceability and context.Current Behavior
Currently, when using the
ai-commit
tool, the generated commit message is in the format:Desired Behavior
Given a branch name that follows the convention
feature/abc-576
,bugfix/abc-577
, etc., the tool should extract the issue name (e.g.,abc-576
) and append it to the commit message. The resulting commit message should be:Use Case
Consider a developer working on a feature branch named
feature/abc-576
. They make some changes and stage them. When they use theai-commit
tool to generate a commit message, the tool should:For example, if the AI-generated commit message is "Added new login functionality", the final commit message should be:
Implementation Suggestions
Benefits
Traceability: By associating commits with specific issues, developers and teams can easily trace changes back to their originating requirements or bug reports.
Context: When reviewing commit histories, having the issue name directly in the commit message provides immediate context about the purpose of the change.
Integration with Other Tools: Many project management and CI/CD tools can utilize the issue name in the commit message for better automation and linking of code changes to tasks.
Alternatives
I am editing the commit message in this way right now,
And I am pushing it.
The text was updated successfully, but these errors were encountered: