commit_ai 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/commit_ai/version.rb +1 -1
- data/lib/commit_ai.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c87ad68cc8d4e50fd42fe7103ccb29775b317ec8bcadd565ae0bfd782803047
|
4
|
+
data.tar.gz: 2aad903b0f30d5332854b909409b168f6c3b90223e9c51954e454f69864f9592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae68dd9f2e8653787744212093d735099f8b02ed01850f15f76c01749d78bac7b9f9d662e011dd38ab1e732f4f335947edaa62c8f608cbbbbd8d23d5bdfdbf1b
|
7
|
+
data.tar.gz: e3ca4b11e589375783c2fc06d6b648d2db313dee57e08b525ca55ccb6e4efd44ca97e3fbbe8ee7ead8c6c526a8ff7f1597bea1233045444777f611a67b63bfa3
|
data/lib/commit_ai/version.rb
CHANGED
data/lib/commit_ai.rb
CHANGED
@@ -48,7 +48,7 @@ class CommitAI
|
|
48
48
|
parameters: {
|
49
49
|
model: "gpt-3.5-turbo",
|
50
50
|
messages: [
|
51
|
-
{ role: "system", content: "You are a
|
51
|
+
{ role: "system", content: "You are a Git commit message generator." },
|
52
52
|
{ role: "user", content: prompt }
|
53
53
|
],
|
54
54
|
max_tokens: 50,
|
@@ -63,6 +63,11 @@ class CommitAI
|
|
63
63
|
system("git add --all")
|
64
64
|
diff = `git diff --staged`
|
65
65
|
|
66
|
+
if diff.empty?
|
67
|
+
puts "No changes to commit."
|
68
|
+
return
|
69
|
+
end
|
70
|
+
|
66
71
|
loop do
|
67
72
|
commit_message = generate_commit_message(diff)
|
68
73
|
puts "Generated Commit Message: #{commit_message}"
|