Skip to main content

git-gen

PyPI - Version PyPI - Python Version

Generate git commit message with a local LLM, which has been fine-tuned on 300K high-quality Python commits and is able to analyze the purposes of the changes

Installation

Required Python 3.10+
To install this package, run:

pip install git-gen

Uses

To generate git commit message in current working directory, run:

git-gen

Generate with custom config:

git-gen --temperature 0.2 --top_k 50 --top_p 0.7

To get all command options, run:

git-gen -h

which should output

Usage:  [OPTIONS]

Options:
  --path PATH                 Path to the project, which should contain a '.git' folder. Default to current working directory.
  --max_tokens INTEGER RANGE  The maximum numbers of tokens to generate.  [default: 1024; x>=1]
  --temperature FLOAT RANGE   Control the overall probabilities of the generation. Prefer lower temperature for higher accuracy and higher temperature for
                              more varied outputs.  [default: 0.7; x>0]
  --top_k INTEGER RANGE       Limit the number of vocabs to consider.  [default: 20; x>=1]
  --top_p FLOAT RANGE         Limit the set of vocabs by cumulative probability.  [default: 0.8; 0<x<=1]
  -h, --help                  Show this message and exit.

FAQ

There are a lot of similar projects. Why would I use this?

A good commit message should reflect the purpose of the changes made concisely. Most LLMs failed to do that at zero-shot learning. This project aims to generate messages that focus on the "why" instead of "what", by using a fine-tuned model on 300K high-quality Python commits.

Moreover, it only uses local LLM. You code is safe from the internet.

License

git-gen is distributed under the terms of the MIT license.

Notes

Build and push project

python -m pip install --upgrade build
python -m build
python -m pip install --upgrade twine
python -m twine upload --repository pypi dist/* --verbose

Release files for git-gen-utils 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-gen-utils 0.0.1
File Size Uploaded
git_gen_utils-0.0.1.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-gen-utils 0.0.1
File Interpreter ABI Platform
git_gen_utils-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.2 kB

Release files / git_gen_utils-0.0.1.tar.gz

Download URL git_gen_utils-0.0.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6f458f6a737f41cfafeb702321c47460e379ce5117d9ad84403b9baac04c3b44
BLAKE2b-256 checksum
How to use checksums
9704480ac85b02fcdb9cfa8ebadc2e39c94d9873b335dc757742b1fe186df10e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Release files / git_gen_utils-0.0.1-py3-none-any.whl

Download URL git_gen_utils-0.0.1-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d3596b75d644a605e4dff8be40706ca92dab8b521fe571c6f288bac13eb1632
BLAKE2b-256 checksum
How to use checksums
c9134087e3a8eeb7f41c89c4345499fc850f8761e8999a9247072aea9d0c0a55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page