-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Ellipsis] Let the user modify the prompt #3
base: main
Are you sure you want to change the base?
Conversation
src/commitm.zsh
Outdated
if [[ -n "$prompt" ]]; then | ||
show_echo "\n$prompt prompt: \e[1m\e[36m$(cat "$commit_message_temp_file")\e[0m\n" | ||
else | ||
show_echo "\n$prompt_mod_description prompt: \e[1m\e[36m$(cat "$commit_message_temp_file")\e[0m\n" | ||
fi |
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.
@ellipsis-dev this isn't the right way to set the prompt. you don't need to echo the prompt that the user passed. the prompt that the user passes should just be used for the llm call. please fix
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.
@marissamarym, I have addressed your comments in commit 21900ba
You can configure Ellipsis to address comments with a direct commit or a side PR, see docs.
… modify the prompt);
src/commitm.zsh
Outdated
@@ -147,7 +155,7 @@ commitm() { | |||
local git_changes=$(cat "$git_output_temp_file") | |||
|
|||
# Prepare the system prompt with modifications and git changes | |||
local full_system_prompt="$system_prompt$prompt_mod" | |||
local full_system_prompt="$system_prompt$prompt_mod$prompt" |
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.
@ellipsis-dev it should replace the default prompt, not add onto it.
if the user specifies a custom prompt, you may need to add some text at the end to incorporate the prompt mod.
please fix
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.
@marissamarym, I have addressed your comments in commit 20fd9e5
You can configure Ellipsis to address comments with a direct commit or a side PR, see docs.
… modify the prompt);
Summary:
Issue: resolves #2
Implementation:
Step 1: Add a new command line option for overriding the default prompt
In the file
src/commitm.zsh
, modify the code that handles command line arguments to include a new option for the prompt. This should be done in the for loop that checks for command line options. Add a new condition that checks for the new option and sets a variable to the value provided by the user. The new option could be--prompt
or-pr
for short. Here is a code snippet for reference:This code should be added after the condition that checks for the
--prefix
option and before the condition that checks for the--execute
option.Step 2: Modify the code that displays the prompt to use the value provided by the user
In the file
src/commitm.zsh
, modify theshow_echo
function call in themodify_prompt
function to use the value of the variable set by the new command line option if it exists. This should be done by adding a condition that checks if the variable is set and, if it is, replacing the default prompt with the value of the variable. Here is a code snippet for reference:This code should replace the existing
show_echo
function call in themodify_prompt
function.Report:
Add a new command line option for overriding the default prompt
Successfully implemented the feature that allows the user to modify the prompt. The user can now use the--prompt
or-pr
option to set a custom prompt, and this prompt will be displayed when the commit message is generated.Modify the code that displays the prompt to use the value provided by the user
Successfully modified theshow_echo
function call in themodify_prompt
function to use the value of theprompt
variable if it is set. If theprompt
variable is not set, the default prompt is used instead.Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #2. Then, try again. For more information, check the documentation.