New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command: new experimental command for generating commit messages #4130
Conversation
The commit introduces a new experimental Cody command for generating commit messages: - `cody.command.generate-commit`: Generates a commit message based on the staged changes. - `cody.command.abort-commit`: Aborts the commit message generation process. The commands are available in the Source Control view and the Command Palette when a Git repository is open.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, left some comments of things I think we should do. I won't get further than this today (need to look into Edit issues on JetBrains), but will take a look next week hopefully.
Also cc @toolmantim for a design review here
* @param abortController - An optional `AbortController` instance to use for aborting the current commit generation. | ||
*/ | ||
private statusUpdate(abortController?: AbortController): void { | ||
const isGenerating = abortController !== undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we possibly use something more specific? Like this.inProgress
instead of checking for the presence of an abortController
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RXminuS and i chatted about this earlier and we think this is easier because we will still need to reset the abortController if we switch to use this.inProgress
, but we can still change it if you don't agree :)
Also, idea: We should use the typewriter |
Show a placeholder text in the source control input box while generating the commit message using AI. This improves the user experience by providing feedback that the operation is in progress. Additionally, this commit handles a case where the source control input box does not have a placeholder property, and falls back to updating the value instead.
…t message generation The Typewriter is used in the streaming function, where it replaces the direct updates to the input box. This approach improves the user experience by providing a more natural typing effect and feedback that the operation is in progress.
Co-authored-by: Tom Ross <tom@umpox.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think let's merge the function and then iterate on the response quality. We can then also add a few different prompts and some metrics on which one's gets comitted as suggested (or hamming distance?). |
@RXminuS Sounds good, anything you want to add, or happy to merge this? |
I still need to merge my e2e test fix I think because they don't pass yet right? |
@RXminuS 👍 yep (only just noticed lol :D) |
Improve the logic for verifying file existence in the git diff context by checking the reverse path. This addresses issues with nested workspaces that may add unknown prefixes to the file paths. Also, add a check to ensure the git diff output is not empty before processing the results.
The commit introduces a new experimental Cody command for generating commit messages:
cody.command.generate-commit
: Generates a commit message based on the staged changes.cody.command.abort-commit
: Aborts the commit message generation process.The commands are available in the Source Control view and the Command Palette when a Git repository is open.
(This commit was generated by the new Cody command 😍 )
TBD
Test plan
New feature covered by a new e2e test.
Manual Tests
From the Cody Commands sidebar
Generate Commit
in theCody Commands sidebar
From the Source Control sidebar
When an ignored file is detected
Generate Commit
in theCody Commands sidebar
or Cody icon in the Source Control panel.