Replies: 2 comments 2 replies
-
That's a great suggestion. You can add this to your own config via a default prompt as per the RECIPES guide. I imagine it's a minor change to the git command. |
Beta Was this translation helpful? Give feedback.
-
I was about to open feature request for the same but before submitting it made me search, checkbox serving its purpose.
Here is my config with Recipes suggestion, default_prompts = {
["Generate a Commit Message for Staged Files"] = {
strategy = "chat",
description = "staged file commit messages",
opts = {
index = 9,
default_prompt = true,
mapping = "<LocalLeader>gm",
slash_cmd = "commit",
auto_submit = true,
},
prompts = {
{
role = "user",
contains_code = true,
content = function()
return "You are an expert at following the Conventional Commit specification. Given the git diff listed below, please generate a commit message for me:"
.. "\n\n```\n"
.. vim.fn.system("git diff --staged")
.. "\n```"
end,
},
},
},
},
|
Beta Was this translation helpful? Give feedback.
-
Hi, would it be possible to create an
/commit-staged
action that prompts the CodeCompanion to generate a commit message based on staged changes instead of unstaged ones?Beta Was this translation helpful? Give feedback.
All reactions