Introduces a new script that uses an LLM to generate commit messages based on the staged diff and current branch name.
7 lines
472 B
Bash
Executable file
7 lines
472 B
Bash
Executable file
#!/bin/zsh
|
|
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
DIFF=$(git diff --staged)
|
|
if [[ -n "$DIFF" ]]; then
|
|
llm "Write a code commit message for this diff on the branch $BRANCH and only output the message itself so it can be used directly to commit. Include a one-line summary, and optionally a description below that if there are lots of changes. Be concise and avoid adding fluff or filler. Wrap the description at 70 characters per line.\n\n\`\`\`\n$DIFF\n\`\`\`"
|
|
fi
|