Open guibranco opened 1 hour ago
Click the checkbox below to generate a PR!
@guibranco, You have 5 requests left in this cycle which refreshes on 2024-10-21 10:07:38+00:00. If you have any questions or concerns, please contact us at info@gitauto.ai.
Description:
I would like to request a feature to automate the creation of a
prepare-commit-msg
Git hook in the repository’s hooks directory. The hook should call a tool that generates an AI-based commit message. The content of the hook should look like the following:This script will automate the commit message generation using the AI commit message tool (
dotnet-aicommitmessage
) before a commit is created, replacing the message in the commit file.Why is this needed?
This feature would enable seamless integration of AI-generated commit messages into the development workflow. Developers wouldn’t need to manually run the AI tool or copy/paste the message into their commits—this would all happen automatically when committing. It provides an improved developer experience and better commit message consistency.
Suggested Implementation:
prepare-commit-msg
file should be created if it doesn't already exist.Example Code:
This C# code creates a
prepare-commit-msg
file in the Git hooks directory that executes thedotnet-aicommitmessage
tool. It ensures that the script is executable and ready to be used in the Git commit workflow.Additional Context:
git
is installed and accessible from the command line.dotnet-aicommitmessage
) should also be installed in the environment.