"default":"The commit message must have a short description that is less than 50 characters long followed by a more detailed description on a new line.",
"default":"Commit messages must have a short description that is less than 50 chars followed by a newline and a more detailed description.\n- Write concisely using an informal tone and avoid specific names from the code",
"markdownDescription":"Specifies the prompt to use to tell OpenAI how to structure or format the generated commit message",
"markdownDescription":"Specifies the prompt to use to tell OpenAI how to structure or format the generated commit message",
content:`You are a highly skilled software engineer and are tasked with writing, in an informal tone, a concise but meaningful commit message summarizing the changes you made to a codebase. ${configuration.get(
'experimental.generateCommitMessagePrompt',
)}Don't repeat yourself and don'tmakeanythingup.Avoidspecificnamesfromthecode.Avoidphraseslike"this commit","this change",etc.`,
content:
"You are an AI programming assistant tasked with writing a meaningful commit message by summarizing code changes.\n\n- Follow the user's instructions carefully & to the letter!\n- Don't repeat yourself or make anything up!\n- Minimize any other prose.",
},
{
role:'user',
content:`${customPrompt}\n- Avoid phrases like "this commit", "this change", etc.`,
},
},
],
],
};
};
@ -131,10 +139,13 @@ export class GenerateCommitMessageCommand extends ActiveEditorCommand {
if(currentMessage){
if(currentMessage){
data.messages.push({
data.messages.push({
role:'user',
role:'user',
content:`Use the following additional context to craft the commit message: ${currentMessage}`,
content:`Use "${currentMessage}" to help craft the commit message.`,
});
});
}
}
data.messages.push({role:'user',content: code});
data.messages.push({
role:'user',
content:`Write a meaningful commit message for the following code changes:\n\n${code}`,