You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,6 +162,16 @@ oco config set OCO_EMOJI=false
162
162
163
163
Other config options are behaving the same.
164
164
165
+
### Output WHY the changes were done (WIP)
166
+
167
+
You can set the `OCO_WHY` config to `true` to have OpenCommit output a short description of WHY the changes were done after the commit message. Default is `false`.
168
+
169
+
To make this perform accurate we must store 'what files do' in some kind of an index or embedding and perform a lookup (kinda RAG) for the accurate git commit message. If you feel like building this comment on this ticket https://github.com/di-sukharev/opencommit/issues/398 and let's go from there together.
var initGlobalConfig = (configPath = defaultConfigPath) => {
@@ -42568,7 +42570,7 @@ Example Git Diff is to follow:`
42568
42570
];
42569
42571
var INIT_MAIN_PROMPT = (language, prompts) => ({
42570
42572
role: "system",
42571
-
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
42573
+
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes ${config2.OCO_WHY ? "and WHY the changes were done" : ""}. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
42572
42574
${config2.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
42573
42575
${config2.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."}
42574
42576
Use the present tense. Use ${language} to answer.
@@ -42588,34 +42590,39 @@ var commitlintPrompts = {
42588
42590
// src/modules/commitlint/pwd-commitlint.ts
42589
42591
var import_promises = __toESM(require("fs/promises"), 1);
var initGlobalConfig = (configPath = defaultConfigPath) => {
@@ -61380,7 +61382,7 @@ Example Git Diff is to follow:`
61380
61382
];
61381
61383
var INIT_MAIN_PROMPT = (language, prompts) => ({
61382
61384
role: "system",
61383
-
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
61385
+
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes ${config2.OCO_WHY ? "and WHY the changes were done" : ""}. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
61384
61386
${config2.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
61385
61387
${config2.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."}
61386
61388
Use the present tense. Use ${language} to answer.
@@ -61400,34 +61402,39 @@ var commitlintPrompts = {
61400
61402
// src/modules/commitlint/pwd-commitlint.ts
61401
61403
var import_promises = __toESM(require("fs/promises"), 1);
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
261
+
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the given @commitlint convention and explain WHAT were the changes ${
262
+
config.OCO_WHY ? 'and WHY the changes were done' : ''
263
+
}. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
0 commit comments