Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/commitm.zsh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ show_help() {
echo " -np, --no-prefix Clear the prefix for the generated message."
echo " -q, --quiet Suppress all output."
echo " -v Show the current version."
echo " -pr, --prompt Set a custom prompt for the commit message."
}

show_version() {
Expand Down Expand Up @@ -43,6 +44,7 @@ commitm() {
local cleaned_up=false
local length_level=0
local is_bot_generated=true
local prompt=""

# Command line argument validation
local is_prefix_set=false
Expand All @@ -68,6 +70,12 @@ commitm() {
prev_arg=""
continue
fi
if [[ "$prev_arg" == "--prompt" ]] || [[ "$prev_arg" == "-pr" ]]; then
prompt="$arg"
# Reset prev_arg
prev_arg=""
continue
fi
prev_arg="$arg"

if [[ "$arg" == "--execute" ]] || [[ "$arg" == "-e" ]]; then
Expand Down Expand Up @@ -137,7 +145,11 @@ commitm() {
g) prompt_mod_description="More general";;
esac

show_echo "\n$prompt_mod_description prompt: \e[1m\e[36m$(cat "$commit_message_temp_file")\e[0m\n"
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
Copy link
Copy Markdown
Owner

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

Copy link
Copy Markdown
Author

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.

}

# Generate the commit message with llm
Expand Down