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
- Add `ViewModels.Preference.PrepareOpenAIPrompt()` method to generate default prompt instead of a const fallback value. Therefore, it is more convenient for us to modify the default value in the Preference dialog.
- Modify the default prompts. Rename `SubjectPrompt` to `GenerateSubjectPrompt`. Rename `SummaryPrompt` to `AnalyzeDiffPrompt`.
- Rewrite the way to build OpenAI user content for subject generation
Signed-off-by: leo <[email protected]>
Copy file name to clipboardExpand all lines: src/Commands/GenerateCommitMessage.cs
+18-50Lines changed: 18 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -10,33 +10,6 @@ namespace SourceGit.Commands
10
10
/// </summary>
11
11
publicclassGenerateCommitMessage
12
12
{
13
-
privateconststringDEFAULT_SUMMARY_PROMPT="""
14
-
You are an expert developer specialist in creating commits.
15
-
Provide a super concise one sentence overall changes summary of the user `git diff` output following strictly the next rules:
16
-
- Do not use any code snippets, imports, file routes or bullets points.
17
-
- Do not mention the route of file that has been change.
18
-
- Simply describe the MAIN GOAL of the changes.
19
-
- Output directly the summary in plain text.
20
-
""";
21
-
22
-
privateconststringDEFAULT_SUBJECT_PROMPT="""
23
-
You are an expert developer specialist in creating commits messages.
24
-
Your only goal is to retrieve a single commit message.
25
-
Based on the provided user changes, combine them in ONE SINGLE commit message retrieving the global idea, following strictly the next rules:
26
-
- Assign the commit {type} according to the next conditions:
27
-
feat: Only when adding a new feature.
28
-
fix: When fixing a bug.
29
-
docs: When updating documentation.
30
-
style: When changing elements styles or design and/or making changes to the code style (formatting, missing semicolons, etc.) without changing the code logic.
31
-
test: When adding or updating tests.
32
-
chore: When making changes to the build process or auxiliary tools and libraries.
33
-
revert: When undoing a previous commit.
34
-
refactor: When restructuring code without changing its external behavior, or is any of the other refactor types.
35
-
- Do not add any issues numeration, explain your output nor introduce your answer.
36
-
- Output directly only one commit message in plain text with the next format: {type}: {commit_message}.
37
-
- Be as concise as possible, keep the message under 50 characters.
<x:Stringx:Key="Text.Preference.AI.SummaryPromptHint"xml:space="preserve">You are an expert developer specialist in creating commits.
409
-
Provide a super concise one sentence overall changes summary of the user `git diff` output following strictly the next rules:
410
-
- Do not use any code snippets, imports, file routes or bullets points.
411
-
- Do not mention the route of file that has been change.
412
-
- Simply describe the MAIN GOAL of the changes.
413
-
- Output directly the summary in plain text.
414
-
</x:String>
415
-
<x:Stringx:Key="Text.Preference.AI.SubjectPromptHint"xml:space="preserve">You are an expert developer specialist in creating commits messages.
416
-
Your only goal is to retrieve a single commit message.
417
-
Based on the provided user changes, combine them in ONE SINGLE commit message retrieving the global idea, following strictly the next rules:
418
-
- Assign the commit {type} according to the next conditions:
419
-
feat: Only when adding a new feature.
420
-
fix: When fixing a bug.
421
-
docs: When updating documentation.
422
-
style: When changing elements styles or design and/or making changes to the code style (formatting, missing semicolons, etc.) without changing the code logic.
423
-
test: When adding or updating tests.
424
-
chore: When making changes to the build process or auxiliary tools and libraries.
425
-
revert: When undoing a previous commit.
426
-
refactor: When restructuring code without changing its external behavior, or is any of the other refactor types.
427
-
- Do not add any issues numeration, explain your output nor introduce your answer.
428
-
- Output directly only one commit message in plain text with the next format: {type}: {commit_message}.
429
-
- Be as concise as possible, keep the message under 50 characters.
You are an expert developer specialist in creating commits messages.
578
+
Your only goal is to retrieve a single commit message.
579
+
Based on the provided user changes, combine them in ONE SINGLE commit message retrieving the global idea, following strictly the next rules:
580
+
- Assign the commit {type} according to the next conditions:
581
+
feat: Only when adding a new feature.
582
+
fix: When fixing a bug.
583
+
docs: When updating documentation.
584
+
style: When changing elements styles or design and/or making changes to the code style (formatting, missing semicolons, etc.) without changing the code logic.
585
+
test: When adding or updating tests.
586
+
chore: When making changes to the build process or auxiliary tools and libraries.
587
+
revert: When undoing a previous commit.
588
+
refactor: When restructuring code without changing its external behavior, or is any of the other refactor types.
589
+
- Do not add any issues numeration, explain your output nor introduce your answer.
590
+
- Output directly only one commit message in plain text with the next format: {type}: {commit_message}.
591
+
- Be as concise as possible, keep the message under 50 characters.
0 commit comments