Skip to content
Open
Changes from 2 commits
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
10 changes: 9 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 @@ -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"
Copy link
Owner

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

Copy link
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 20fd9e5


You can configure Ellipsis to address comments with a direct commit or a side PR, see docs.

local git_changes_formatted="$git_changes"


Expand Down