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
9 changes: 8 additions & 1 deletion git-qcommit
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ if ! git diff --cached --quiet; then
TEMP_FILE=$(mktemp /tmp/git-qcommit-XXXXXX)

# Generate commit message using Amazon Q and write to temporary file
echo -e "Based on the staged git changes, generate a descriptive git commit message and write it to $TEMP_FILE. Feel free to use appropriate gitmoji/emoji icons. Include what was changed and why. Don't include any markdown formatting or code blocks.\n\nPrompt: $PROMPT" | q chat -a
echo -e "Based on the staged git changes, generate a descriptive git commit message \
and write it to $TEMP_FILE. Feel free to use appropriate gitmoji/emoji icons. \
Include what was changed and why. Don't include any markdown formatting or code \
blocks.\n\nPrompt: $PROMPT" | q chat -a \
--no-interactive \
--trust-tools=fs_read,fs_write,execute_bash,internal_command,thinking,\
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract out to variables for both the trust-tools list and the initial prompt that is passed to q chat.

fetch___fetch,git___git_add,git___git_diff,git___git_diff_staged,\
git___git_diff_unstaged,git___git_log,git___git_show,git___git_status

# Check if the temporary file exists and has content
if [ -s "$TEMP_FILE" ]; then
Expand Down