Title: | Automated Git Commit Messages using the 'OpenAI' 'GPT' Model |
---|---|
Description: | Automates the process of adding, committing, and pushing changes to a 'git' repository using commit messages generated by passing the git diff output to the 'OpenAI' 'GPT-3.5 Turbo' model (<https://platform.openai.com/docs/models/gpt-3>). |
Authors: | Steve Condylios [aut, cre] |
Maintainer: | Steve Condylios <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.3 |
Built: | 2024-10-27 02:47:34 UTC |
Source: | https://github.com/stevecondylios/gitgpt |
Aautomates the process of adding changes to a Git repository, committing those changes with a commit message, and pushing the changes to a remote repository.
add_commit_push(commit_message, prepend)
add_commit_push(commit_message, prepend)
commit_message |
A character string containing the commit message for the changes. |
prepend |
A character string to prepend to the commit message. Defaults to an empty string. |
No return value, called for side effects.
## Not run: add_commit_push() ## End(Not run)
## Not run: add_commit_push() ## End(Not run)
An R wrapper to automatically add, commit, and push changes to a git repository using an auto-generated commit message. The commit message is generated by an API call to the 'OpenAI' 'GPT-3.5 Turbo' model using the git diff output as input.
commit(commit_message, prepend)
commit(commit_message, prepend)
commit_message |
A custom commit message. If not provided, a message will be generated automatically. |
prepend |
A string to prepend to the commit message. Defaults to an empty string. A convention may be to prepend 'GPT: ' to the beginning of the commit message so you can differentiate between those you wrote vs those GPT composed. |
No return value, called for side effects.
## Not run: # Simple command to git add, git commit, and git push with a commit # message based on git diff of the working directory commit() ## End(Not run)
## Not run: # Simple command to git add, git commit, and git push with a commit # message based on git diff of the working directory commit() ## End(Not run)
Generates a commit message by making an API call to the 'OpenAI' 'GPT-3.5 Turbo' model using the encoded git diff output as input.
generate_commit_message(encoded_git_diff_output)
generate_commit_message(encoded_git_diff_output)
encoded_git_diff_output |
A character vector containing the URL-encoded git diff output. |
A character vector of length 1 containing the generated commit message.
## Not run: # Sends the encoded git diff to GPT and returns a # character vector containing the commit message: git_diff_output <- generate_git_diff_output() edo <- generate_encoded_git_diff_output(git_diff_output) enerate_commit_message(edo) ## End(Not run)
## Not run: # Sends the encoded git diff to GPT and returns a # character vector containing the commit message: git_diff_output <- generate_git_diff_output() edo <- generate_encoded_git_diff_output(git_diff_output) enerate_commit_message(edo) ## End(Not run)
Takes the git diff output and encodes it for use in the API call to the 'OpenAI' 'GPT-3.5 Turbo' model.
generate_encoded_git_diff_output(git_diff_output)
generate_encoded_git_diff_output(git_diff_output)
git_diff_output |
A character vector containing the git diff output. |
A character vector containing the URL-encoded git diff output.
## Not run: git_diff_output <- generate_git_diff_output() generate_encoded_git_diff_output(git_diff_output) ## End(Not run)
## Not run: git_diff_output <- generate_git_diff_output() generate_encoded_git_diff_output(git_diff_output) ## End(Not run)
Returns the git diff output for the current working directory, and lists any new files found. It checks the system's OS and executes the appropriate command to generate the git diff.
generate_git_diff_output()
generate_git_diff_output()
A character vector containing the git diff output.
## Not run: # View with cat() for easier reading cat(generate_git_diff_output()) ## End(Not run)
## Not run: # View with cat() for easier reading cat(generate_git_diff_output()) ## End(Not run)
An R wrapper that automates the process of adding, committing, and pushing changes to a git repository using auto-generated commit messages. Leverages the 'OpenAI' 'GPT-3.5 Turbo' model to generate meaningful commit messages based on the git diff output.
- commit
: Automatically adds, commits, and pushes changes using
an auto-generated or custom commit message.
- generate_git_diff_output
: Returns the git diff output for the
current working directory.
- generate_encoded_git_diff_output
: Encodes the git diff output
for use in the API call to the 'OpenAI' 'GPT-3.5 Turbo' model.
- generate_commit_message
: Generates a commit message using an
API call to the 'OpenAI' 'GPT-3.5 Turbo' model with the encoded git diff output.
- add_commit_push
: Adds, commits, and pushes changes to a git
repository using the provided commit message.
Suggests a commit message by utilizing the 'OpenAI' 'GPT-3.5 Turbo' model. It takes a git diff as input and returns a meaningful commit message.
suggest_commit_message(diff)
suggest_commit_message(diff)
diff |
An optional character vector containing the git diff. If not provided, the function will automatically generate the git diff output for the current working directory. |
A character vector of length 1 with the suggested commit message based on the provided git diff.
## Not run: suggest_commit_message() ## End(Not run)
## Not run: suggest_commit_message() ## End(Not run)