Open FozzieHi opened 3 months ago
I don't use the /commit
, My current workaround is "CMD+Shift+P" -> "Git: commit staged" -> "CMD+I" -> "Write commit using conventional commit standards":
Neat workflow @priyashpatil ! This could be a useful custom quick action, although I'm unsure if there is a LSP extension for git files like this that we would need.
@FozzieHi - thanks for calling this out. I think if anything the default behavior should be to only generate the commit off of staged changes, and then we could add a param to optionally include unstaged changes (e.g. includeUnstaged
).
If we made that change, I think we would want to provide some sort of helpful feedback to the user in the scenario where they attempt to generate a commit but haven't staged any changes.
We would definitely welcome a PR if you're interested in taking this on!
@Patrick-Erichsen Sounds good. I did assume it was only doing staged changes to begin with until I started to realise it was writing about unstaged changes as well. I do have a demo running locally, I'll just swap around the params and create a PR.
Excellent, looking forward to the PR!
Validations
Problem
I'd like to run the
/commit
slash command only on staged changes, as opposed to all changes which is the current behaviour.Solution
Add a boolean parameter to the commit slash command called
stagedOnly
. If true, include only the staged changes; If false, include both staged and unstaged changes. I'm happy to create a PR with this functionality.