git-gpt 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +49 -21
- data/git-gpt.gemspec +2 -2
- data/lib/git/gpt/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 848d9c6a4ae6f3e034ad83ef04d112dc43172eaa29f13697b5ab677f0d31ab90
|
4
|
+
data.tar.gz: cfded1c59cfba5df552360d5f37632727a111b57b80a3c3a14bca594af265827
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21f728913149d02780f1a63177695b05b7b15cd47f595c1af1652dfa0f04cea1b209a71605b99405cc5f1ca5be6d8f7ad56e5a9a80a55f075b3fbe279dedf755
|
7
|
+
data.tar.gz: 273d32a80efb211c9e0be1a53c630e7a8b06efa0413771be434ce9bdb4e05e920d01d7813d0e1801b475acf0301f7ccdd46a687189e929d5af82daab0a8243a0
|
data/README.md
CHANGED
@@ -1,43 +1,71 @@
|
|
1
1
|
# Git::Gpt
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
git-gpt is a ruby gem that adds an additional git subcommand, git gpt. It assists you in creating commit messages for your git changes. It uses the powerful capabilities of ChatGPT to generate commit messages based on the current git status and git diff. Additionally, you can specify a list of files to narrow down the context for the commit message.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
|
7
|
+
First, you need to install the gem. You can do this globally or in your specific Ruby environment.
|
10
8
|
|
11
|
-
```
|
12
|
-
gem
|
9
|
+
```sh
|
10
|
+
gem install git-gpt
|
13
11
|
```
|
14
12
|
|
15
|
-
|
13
|
+
Once installed, it will be accessible as a git subcommand.
|
16
14
|
|
17
|
-
|
15
|
+
## Usage
|
18
16
|
|
19
|
-
|
17
|
+
You can invoke the `git gpt` command in your terminal anywhere in your git repository:
|
20
18
|
|
21
|
-
$ gem install git-gpt
|
22
19
|
|
23
|
-
|
20
|
+
```sh
|
21
|
+
git gpt
|
22
|
+
```
|
24
23
|
|
25
|
-
|
24
|
+
This will return a commit message generated by ChatGPT based on the changes detected by `git status` and `git diff`.
|
26
25
|
|
27
|
-
|
26
|
+
If you wish to narrow down the context to a specific list of files, you can do so by passing them as arguments:
|
28
27
|
|
29
|
-
|
28
|
+
```sh
|
29
|
+
git gpt file1 file2 file3
|
30
|
+
```
|
30
31
|
|
31
|
-
|
32
|
+
In the above example, `file1`, `file2`, and `file3` are placeholders for the file names you want to focus on. This will generate a commit message based on the changes in those files only.
|
32
33
|
|
33
|
-
##
|
34
|
+
## Basic Configuration
|
34
35
|
|
35
|
-
|
36
|
+
Best practice is to set the `OPENAI_API_KEY` environment veriable. Optionally, you can set `OPENAI_ORGANIZATION_ID`.
|
36
37
|
|
37
|
-
##
|
38
|
+
## Advanced Configuration
|
39
|
+
|
40
|
+
By default `git gpt` uses `gpt-3.5-turbo` with a temperature of `0.7`. You can find the default prompt [here](https://github.com/assaydepot/git-gpt/blob/main/lib/git/gpt.rb#L12-L26). If you'd like to change the default settings, you can add a `.git-gpt-config.yml` file in your git repository. `git-gpt` will look for that file in the current directory, any parent directory (all the way to `/`) and your `HOME` directory. It will look in that order and use the first one it finds. The structure of the YAML file is as follows, all keys are optional.
|
41
|
+
|
42
|
+
```yaml
|
43
|
+
model: gpt-4
|
44
|
+
temperature: 0.8
|
45
|
+
openai_api_key: sk-acb1234567890xyz
|
46
|
+
openai_organization_id: org-abc1234567890xyz
|
47
|
+
prompt: >
|
48
|
+
You are a software engineer working on a project. You write diligent and detailed commit messages. You are working on a new feature and you are ready to commit your changes.
|
38
49
|
|
39
|
-
The
|
50
|
+
The current git status is:
|
51
|
+
\```
|
52
|
+
$GIT_STATUS
|
53
|
+
\```
|
40
54
|
|
41
|
-
|
55
|
+
The current git diff is:
|
56
|
+
\```
|
57
|
+
$GIT_DIFF
|
58
|
+
\```
|
59
|
+
|
60
|
+
Please write a commit message for this change. Format the commit message using markdown. You may use bullet points. Please comment specifically on any files with significant changes.
|
61
|
+
```
|
62
|
+
|
63
|
+
See a real example [here](https://github.com/assaydepot/git-gpt/blob/main/.git-gpt-config.yml).
|
64
|
+
|
65
|
+
## Contributing
|
66
|
+
|
67
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/your-github-username/git-gpt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
|
68
|
+
|
69
|
+
## License
|
42
70
|
|
43
|
-
|
71
|
+
The gem is available as open source under the terms of the MIT License.
|
data/git-gpt.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Chris Petersen"]
|
9
9
|
spec.email = ["chris@petersen.io"]
|
10
10
|
|
11
|
-
spec.summary = "Use
|
12
|
-
spec.description = "Use
|
11
|
+
spec.summary = "Use ChatGPT to write your commit messages"
|
12
|
+
spec.description = "Use ChatGPT to write your commit messages"
|
13
13
|
spec.homepage = "https://github.com/assaydepot/git-gpt"
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = ">= 2.6.0"
|
data/lib/git/gpt/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-gpt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Petersen
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
|
-
description: Use
|
27
|
+
description: Use ChatGPT to write your commit messages
|
28
28
|
email:
|
29
29
|
- chris@petersen.io
|
30
30
|
executables:
|
@@ -71,5 +71,5 @@ requirements: []
|
|
71
71
|
rubygems_version: 3.3.7
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
|
-
summary: Use
|
74
|
+
summary: Use ChatGPT to write your commit messages
|
75
75
|
test_files: []
|