Created
July 12, 2024 17:21
-
-
Save emmadesilva/2c594879ec6bfea64c8c60bb2f236564 to your computer and use it in GitHub Desktop.
Personal AI commit message model generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // SIMPLIFIED MODEL GENERATOR | |
| $raw = trim(shell_exec('git log --pretty=format:"%s" --first-parent master')); | |
| $lines = explode("\n", $raw); | |
| $lines = filter_duplicates_keeping_first_matches($lines); | |
| $lines = filter_lines_starting_with($lines, ['Merge', 'Revert', 'Reapply', 'Bump']); | |
| file_put_contents(__DIR__.'/commit-message-model.txt', implode("\n", $lines)); | |
| // Next step: Pass the file to a capable LLM with a high context window, using this prompt: | |
| // > Here is a list of commit messages, please compress these into a model that can be | |
| // > used to replicate the commit message style when using an LLM/GPT model like | |
| // > yourself to create similar looking commit messages from Git diffs. |
Author
Author
Usage:
Create a Git commit message for this patch. Provide 5 options matching the style guide added below the patch.
Paste patch here
Paste model here
Example response:
Claude Sonnet
Thank you for providing the patch and the commit message style guide. I'll create 5 options for Git commit messages that match the given style guide. Here are the options:
- Add commit message model generator script
- Create PHP script for generating commit message models
- Implement AI-assisted commit message generation tool
- Add script to extract and filter Git commit messages
- Create tool for building commit message style models
These options follow the style guide by starting with an imperative verb, specifying the target, and providing context where appropriate. They are concise and clear, focusing on the main purpose of the added script.
ChatGPT 4o
Here are five commit message options following the provided style guide:
Create commit-message-model-generator scriptAdd script to generate commit message modelSimplify commit message model creation processDocument commit message model generation scriptFormat output of commit message model generator script
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result: