Coder Social home page Coder Social logo

chatgpt_commit_message_hook's Introduction

๐Ÿค– ChatGPT Commit Message Hook ๐Ÿช

Let ChatGPT write your commit messages.

Repository's starts Issues License
Latest commit GitHub repository size

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 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
  1. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.