Skip to content

Commit 5ac67c0

Browse files
committed
feat: Add custom commit message template support with placeholders
1 parent b2f2393 commit 5ac67c0

File tree

3 files changed

+538
-402
lines changed

3 files changed

+538
-402
lines changed

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,21 @@
156156
"type": "string",
157157
"enum": [
158158
"conventional",
159-
"gitmoji"
159+
"gitmoji",
160+
"custom"
160161
],
161162
"enumDescriptions": [
162163
"Conventional Commits format: <type>[optional scope]: <description>",
163-
"Gitmoji format with emoji prefixes: 🎨 :<emoji>: <description>"
164+
"Gitmoji format with emoji prefixes: 🎨 :<emoji>: <description>",
165+
"Custom user-defined format using a template with placeholders"
164166
],
165167
"default": "conventional",
166-
"markdownDescription": "Choose the commit message format style:\n\n- **conventional**: Standard Conventional Commits format (e.g., `feat: add new feature`)\n- **gitmoji**: Commits with emoji prefixes (e.g., `✨ feat: add new feature`)"
168+
"markdownDescription": "Choose the commit message format style:\n\n- **conventional**: Standard Conventional Commits format (e.g., `feat: add new feature`)\n- **gitmoji**: Commits with emoji prefixes (e.g., `✨ feat: add new feature`)\n- **custom**: Fully customizable template with placeholders (configure via Custom Commit Prompt setting)"
169+
},
170+
"diffy-explain-ai.customCommitPrompt": {
171+
"type": "string",
172+
"default": "Generate a commit message for the following git diff.\n\nRequirements:\n- Maximum subject length: {maxLength} characters\n- Use imperative mood\n- Be concise and clear{bodyInstructions}\n\nReturn ONLY the commit message, no explanations.",
173+
"markdownDescription": "Custom commit message generation prompt when **Commit Message Type** is set to `custom`. \n\nSupported placeholders:\n- `{maxLength}` - Maximum subject line length\n- `{bodyInstructions}` - Auto-filled based on Include Commit Body setting\n- `{locale}` - Language/locale for the message\n- `{diff}` - The actual git diff (automatically appended)\n\nExample template:\n```\nGenerate a {locale} commit message following our team convention:\n- Start with JIRA ticket: [PROJ-XXX]\n- Subject max {maxLength} chars\n- Include impact analysis{bodyInstructions}\n```"
167174
},
168175
"diffy-explain-ai.includeCommitBody": {
169176
"type": "boolean",

0 commit comments

Comments
 (0)