Skip to content

Commit 942d412

Browse files
committed
Allow editing of AI-generated commit messages before committing
1 parent 727a305 commit 942d412

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

zsh-git-ai.plugin.zsh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,14 @@ git() {
9595
return 1
9696
fi
9797

98-
# Execute the commit directly with the generated message
99-
command git commit -m "$generated_message"
98+
# Move cursor to beginning of line and clear it
99+
echo -ne "\r\033[K"
100+
101+
# Put the command in the buffer for editing
102+
print -z "git commit -m \"$generated_message\""
103+
104+
# Return false to prevent execution of the original command
105+
return 1
100106
else
101107
echo "No changes staged for commit"
102108
return 1

0 commit comments

Comments
 (0)