diff --git a/bin/commit-with-llm b/bin/commit-with-llm index a1b4243..e06e0ee 100755 --- a/bin/commit-with-llm +++ b/bin/commit-with-llm @@ -6,9 +6,13 @@ function commit-with-llm() { PROMPT_FILE="tmp/llm_update" echo -e "\nWrite prompt to $PROMPT_FILE." cat << EOF > "$PROMPT_FILE" -Look at the git diff below and reply with a git commit message. Ensure that the commit message matches the conventional commits specification. -If possible add a scope. Reply with the commit message only. +Look at the git log and the git diff below and reply with a git commit message matching the changes and style of the log. +The commit message must comply with the conventional commits specification. Reply with the commit message only. +<<< git log -n 5 --pretty=format:"%ci: %B" >>> +$(git log -n 5 --pretty=format:"%ci: %B") + +<<< git diff --staged >>> $(git diff --staged) EOF @@ -40,4 +44,4 @@ EOF if [[ "$CONFIRM" =~ ^[Ee]$ ]]; then git commit --amend fi -} \ No newline at end of file +}