Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tom-doerr/chatgpt_commit_message_hook
Enhance your git workflow using AI-generated commit messages from ChatGPT. Seamless integration for a well-documented commit log.
https://github.com/tom-doerr/chatgpt_commit_message_hook
chatgpt git git-hooks openai
Last synced: 3 months ago
JSON representation
Enhance your git workflow using AI-generated commit messages from ChatGPT. Seamless integration for a well-documented commit log.
- Host: GitHub
- URL: https://github.com/tom-doerr/chatgpt_commit_message_hook
- Owner: tom-doerr
- License: mit
- Created: 2023-03-03T16:38:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-03T12:31:33.000Z (about 1 year ago)
- Last Synced: 2024-06-03T09:48:00.146Z (5 months ago)
- Topics: chatgpt, git, git-hooks, openai
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 71
- Watchers: 2
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - tom-doerr/chatgpt_commit_message_hook - Enhance your git workflow using AI-generated commit messages from ChatGPT. Seamless integration for a well-documented commit log. (Python)
README
🤖 ChatGPT Commit Message Hook 🪝
Let ChatGPT write your commit messages.
ChatGPT will provide a suggestion for the commit message.
# ChatGPT Commit Message Hook
## What is it?
This is a hook for git that generates commit messages.
It uses [OpenAI's ChatGPT](https://openai.com/blog/chatgpt)
to generate commit messages.## How do I install it?
### Setup
1. Install packages (`pip install -r requirements.txt`).
2. Create a file at `$XDG_CONFIG_HOME/openaiapirc` with your API keys.
3. [optional] Add proxy server settings to the config file. Http proxy is supported only.
4. [optional] The maximum number of changed lines in a commit. If the number of changed lines is greater than this value, the hook will send the result of git diff --cached --stat, otherwise it will send git diff --cached. The default value is 80.For example:
```
[openai]
secret_key = MY_SECRET_KEY
proxy= HTTP_PROXY
max_changed_lines=80
```
5. Install the hook:
```
git clone https://github.com/jsfs2019/chatgpt_commit_message_hook
cd chatgpt_commit_message_hook
sudo make install
```This will set up the hook for all new repositories.
To add the hook to an existing repository, run `git init`.## How does it work?
The hook gets the current commit message, runs ChatGPT to generate a new commit
message, and then replaces the current commit message with the generated message.